PHP code example of iachilles / eavactiverecord

1. Go to this page and download the library: Download iachilles/eavactiverecord 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/ */

    

iachilles / eavactiverecord example snippets


array(
     'import' => array(
     'application.components.eavactiverecord.*',
     'application.components.eavactiverecord.datatypes.*',
     'application.components.eavactiverecord.helpers.*'
)

array(
    …
    'components'=>array(
        …
        'cache'=>array(
            'class'=>'system.caching.CMemCache',
            'servers'=>array(
                array('host'=>'server1', 'port'=>11211, 'weight'=>60),
                array('host'=>'server2', 'port'=>11211, 'weight'=>40),
            ),
        ),
    ),
);

array(
    …
    'components'=>array(
        …
        'eavCache'=>array(
            'class'=>'system.caching.CMemCache',
            'servers'=>array(
                array('host'=>'server1', 'port'=>11211, 'weight'=>60),
                array('host'=>'server2', 'port'=>11211, 'weight'=>40),
            ),
        ),
    ),
);

'components' => array(
        'eavCache' => array(
            'class' => 'system.caching.CDummyCache'
        ),
     )

class Foo extends EavActiveRecord

Foo::model()->addColumn();