PHP code example of jeanvaljean / active-behavior

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

    

jeanvaljean / active-behavior example snippets


['type' => 'integer', 'default' => 0, 'limit' => 1, 'null' => false]

$this->addBehavior('Active.Active');

$this->addBehavior('Active.Active', [
	'active_field' => 'active', // the table's field you want for storing the active state of an entity
	'group' => '', // the table's field you want to use for grouping the active behavior on specific entities
	'keep_active' => true, // to make sure that always one entity is active
	'multiple' => false // to authorize several entities to be active
]);