Beispiel #1
0
 /**
  * @param  Record $record
  * @return array
  */
 private function getFieldNamesForValidation(Record $record)
 {
     if ($record->exists()) {
         $fields = $record->getModifiedFields();
     } else {
         $table = $record->getTable();
         $fields = $table->getFields();
         if ($table->hasAutoIncrementTrigger()) {
             $idFields = $table->getIdentifierFields();
             foreach ($idFields as $idFieldName) {
                 unset($fields[$idFieldName]);
             }
         }
     }
     return array_keys($fields);
 }
Beispiel #2
0
 /**
  * @param Record $record
  * @return bool
  */
 private function hasRecordIdentifierChanged(Record $record)
 {
     $identifierFields = $record->getTable()->getIdentifierFields();
     $modifiedFields = $record->getModifiedFields();
     return (bool) array_intersect($identifierFields, array_keys($modifiedFields));
 }