PHP code example of lorenzo / linkable

1. Go to this page and download the library: Download lorenzo/linkable library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lorenzo / linkable example snippets


	
		class AppModel extends Model {
		
			public $actsAs = array('Containable', 'Linkable.Linkable');
		
	}

	
	$this->TestRun->CasesRun->find('all', array(
		'link' => array(
			'User' => array('fields' => 'username'),
			'TestCase' => array('fields' => array('TestCase.automated', 'TestCase.name'),
				'TestSuite' => array('fields' => array('TestSuite.name'),
					'TestHarness' => array('fields' => array('TestHarness.name'))
					)
				)
			),
		'conditions' => array('test_run_id' => $id),
		'contain' => array(
			'Tag'
			),
		'fields' => array(
			'CasesRun.id', 'CasesRun.state', 'CasesRun.modified', 'CasesRun.comments'
			)
		));


$this->Article->find('all', array(
	'contain' => array(
		'Author'
	),
	'link' => array(
		'Comment'
	),
	'conditions' => array(
		'Comment.user_id' => 1
	)
));