Пример #1
0
 protected function _getForeignKeyWhereClause(Garp_Db_Table_Row $record, $model, $foreignKeyColumns)
 {
     $whereData = array_get_subset($record->toArray(), $foreignKeyColumns);
     // Assume one "id" primary key
     if (count($foreignKeyColumns) > 1) {
         throw new Exception("Can't deal with multiple foreign keys right now!");
     }
     $whereData = array_combine(array('id'), array_values($whereData));
     return $model->arrayToWhereClause($whereData);
 }
Пример #2
0
 /**
  * @param   Garp_Db_Table_Row   $row        Unfiltered row
  * @param   Array               $columns    Elasticsearchable column names of the base model
  * @return  Array                           Filtered row
  */
 public function filter(Garp_Db_Table_Row $row, array $columns)
 {
     $rowArray = $row->toArray();
     $filteredRow = $this->_filterRow($rowArray, $columns);
     return $filteredRow;
 }
Пример #3
0
 protected function _pushRecord(Garp_Model_Db $model, Garp_Model_Behavior_Abstract $phpBehavior, Garp_Db_Table_Row $record)
 {
     $primaryKey = current($record->toArray());
     $phpBehavior->afterSave($model, $primaryKey);
 }