Example #1
0
 /**
  * Is empty?
  *
  * @param array $record
  *
  * @return bool empty?
  */
 public function isEmpty($record)
 {
     $empty = parent::isEmpty($record);
     // if bool_obligatory flag is set the value must be true else we treat this record as empty
     if ($this->hasFlag(self::AF_BOOL_OBLIGATORY) && !$this->getValue($record)) {
         $empty = true;
     }
     return $empty;
 }
Example #2
0
 /**
  * Validate attribute value.
  *
  * @param Attribute $p_attrib pointer to the attribute
  * @param array $record record
  */
 public function validateAttributeValue($p_attrib, &$record)
 {
     if (!$p_attrib->isEmpty($record)) {
         $funcname = $p_attrib->m_name . '_validate';
         if (method_exists($this->m_nodeObj, $funcname)) {
             $this->m_nodeObj->{$funcname}($record, $this->m_mode);
         } else {
             $p_attrib->validate($record, $this->m_mode);
         }
     }
 }
Example #3
0
 /**
  * Check if a record has an empty value for this attribute.
  *
  * @param array $record The record that holds this attribute's value.
  *
  * @return bool
  */
 public function isEmpty($record)
 {
     return parent::isEmpty($record) || $record[$this->fieldName()] == 0;
 }