PHP code example of armenio / armenio-zf2-cakephp-orm-module

1. Go to this page and download the library: Download armenio/armenio-zf2-cakephp-orm-module 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/ */

    

armenio / armenio-zf2-cakephp-orm-module example snippets


'modules' => array(
	 'Application',
	 'CakePHP', //<==============================
)

	'CakePHP' => array(
		'Configure' => array(
			'App' => array(
				'namespace' => 'Custom' //<======= put your App/Module namespace HERE!
			),
		),
	),


namespace Custom\Model\Table;

use CakePHP\Model\Table as CakePHPTable;

class MyModelTable extends CakePHPTable
{

	protected $_table = 'my_table';

	protected $_alias = 'MyModel';

	protected $_primaryKey = 'id';
}


use Cake\ORM\TableRegistry;
$table = TableRegistry::get('MyModel');
$all = $table->find('all');