コード例 #1
0
ファイル: relatable.php プロジェクト: nooku/nooku-files
 /**
  * Insert the model states
  *
  * @param KObjectMixable $mixer
  */
 public function onMixin(KObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     if ($mixer instanceof KModelDatabase) {
         foreach ($this->_columns as $name => $filter) {
             $mixer->getState()->insert($name, $filter);
         }
     }
 }
コード例 #2
0
 /**
  * Insert the model states
  *
  * @param KObjectMixable $mixer
  */
 public function onMixin(KObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     if ($mixer instanceof KModelDatabase) {
         $table = $mixer->getTable();
         // Set the dynamic states based on the unique table keys
         foreach ($table->getUniqueColumns() as $key => $column) {
             $mixer->getState()->insert($key, $column->filter, null, true, $table->mapColumns($column->related, true));
         }
     }
 }
コード例 #3
0
ファイル: nestable.php プロジェクト: kosmosby/medicine-prof
 public function onMixin(KObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     if ($mixer instanceof KModelDatabase) {
         $state = $mixer->getState();
         if (!isset($state->parent_id)) {
             $state->insert('parent_id', 'int');
         }
         if (!isset($state->level)) {
             $state->insert('level', 'int');
         }
         if (!isset($state->max_level)) {
             $state->insert('max_level', 'int');
         }
         if (!isset($state->include_self)) {
             $state->insert('include_self', 'boolean', false);
         }
         $state->setProperty('sort', 'default', 'title');
         return true;
     } else {
         return false;
     }
 }
コード例 #4
0
 /**
  * Insert the model states
  *
  * @param KObjectMixable $mixer
  */
 public function onMixin(KObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     $mixer->getState()->insert('search', 'string');
 }
コード例 #5
0
 /**
  * Insert the model states
  *
  * @param KObjectMixable $mixer
  */
 public function onMixin(KObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     $mixer->getState()->insert('limit', 'int')->insert('offset', 'int');
 }
コード例 #6
0
 /**
  * Insert the model states
  *
  * @param KObjectMixable $mixer
  */
 public function onMixin(KObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     $mixer->getState()->insert('sort', 'cmd')->insert('direction', 'word', 'asc');
 }