library/Garp/Spawn/Fields.php
public function add($origin, $name, array $params = array()) {
        if (!$this->exists($name)) {
            $field = new Garp_Spawn_Field($origin, $name, $params);
            if ($origin === 'default')
                array_unshift($this->_fields, $field);
            else
                $this->_fields[] = $field;
        }
        else throw new Exception("The '{$name}' field is already registered for this model.");
    }
public function add($origin, $name, array $params = array()) {
        if (!$this->exists($name)) {
            $field = new Garp_Spawn_Field($origin, $name, $params);
            if ($origin === 'default')
                array_unshift($this->_fields, $field);
            else
                $this->_fields[] = $field;
        }
        else throw new Exception("The '{$name}' field is already registered for this model.");
    }
public function add ( $ origin , $ name , array $ params = array ( ) ) { if ( ! $ this -> exists ( $ name ) ) { $ field = new Garp_Spawn_Field ( $ origin , $ name , $ params ) ; if ( $ origin === 'default' ) array_unshift ( $ this -> _fields , $ field ) ; else $ this -> _fields [ ] = $ field ; } else throw new Exception ( "The '{$name}' field is already registered for this model." ) ; }
Add a field to the fields registry.
@param String $origin Context in which this field is added. Can be 'config', 'default', 'relation' or 'behavior'.
@param String $name Field name.
Add a field to the fields registry .