Example #1
0
 /**
  * Inserts an record for approval
  *
  * @param integer $type
  * @param PSX_Data_RecordInterface $record
  * @return void
  */
 public function approveRecord($type, RecordInterface $record)
 {
     $type = Record::getType($type);
     if ($type !== false) {
         $date = new DateTime('NOW', $this->registry['core.default_timezone']);
         $this->sql->insert($this->registry['table.core_approval_record'], array('userId' => $this->user->id, 'type' => $type, 'table' => $this->table->getName(), 'record' => serialize($record->getFields()), 'date' => $date->format(DateTime::SQL)));
     } else {
         throw new Exception('Invalid approve record type');
     }
 }
Example #2
0
File: Type.php Project: visapi/amun
 public function apply($value)
 {
     return in_array($value, Approval\Record::getType());
 }