Esempio n. 1
0
 /**
  * Insert the model states
  *
  * @param ObjectMixable $mixer
  */
 public function onMixin(ObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     if ($mixer instanceof ModelDatabase) {
         $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));
         }
     }
 }
Esempio n. 2
0
 /**
  * Insert the model states
  *
  * @param ObjectMixable $mixer
  */
 public function onMixin(ObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     $mixer->getState()->insert('search', 'string');
 }
Esempio n. 3
0
 /**
  * Insert the model states
  *
  * @param ObjectMixable $mixer
  */
 public function onMixin(ObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     $mixer->getState()->insert('limit', 'int')->insert('offset', 'int');
 }
Esempio n. 4
0
 /**
  * Insert the model states
  *
  * @param ObjectMixable $mixer
  */
 public function onMixin(ObjectMixable $mixer)
 {
     parent::onMixin($mixer);
     $mixer->getState()->insert('sort', 'cmd')->insert('direction', 'word', 'asc');
 }