Ejemplo n.º 1
0
 /**
  * parse un tableau en attribut
  *
  * @param array $record
  */
 protected function parse($record)
 {
     $this->id = $record['id'];
     $this->name = $record['name'];
     $this->type = $record['type'];
     $this->is_unicity = boolval($record['isUnicity']);
     $this->is_obligatory = boolval($record['isMandatory']);
     if (isset($record['valueListId'])) {
         $this->value_list = $record['valueListId'];
     } else {
         $this->value_list = null;
     }
     if (isset($record['constraint'])) {
         $this->constraint = array('value' => $record['constraint']['value'], 'operator' => array('value' => $record['constraint']['operator'], 'string' => Operators::operatorToString($record['constraint']['operator'])));
     } else {
         $this->constraint = null;
     }
 }