Ejemplo n.º 1
0
 /**
  * Returns simple entity description by entity type. Use in templates.
  *
  * @param string $type
  * @return hash
  */
 public function getEntityDescriptionByType($type)
 {
     $result = array();
     $result['fields'] = $this->_mapper->fields('entity_' . $type);
     $result['rules'] = $this->_mapper->rules('entity_' . $type);
     return $result;
 }
Ejemplo n.º 2
0
 /**
  * Enter description here...
  *
  * @return bool
  */
 protected function _checkData()
 {
     if ($this->_typeProps) {
         if ($rules = $this->_mapper->rules('entity_' . $this->type)) {
             $validator = M('Validator')->create($rules);
             $validator->check(array_merge($this->_props, $this->_typeProps));
         }
     }
     return TRUE;
 }