public function addField($fieldName, $getMethod, $setMethod, ByConfigBuilder $include = null, $formatter = null)
    {
        if (method_exists($this->getEntityPrototype(), $getMethod) === false) {
            throw new Exception\ConfigFailed(sprintf($this->exceptions[2], $getMethod, $this->entityClassName), 2);
        }

        if (method_exists($this->getEntityPrototype(), $setMethod) === false) {
            throw new Exception\ConfigFailed(sprintf($this->exceptions[2], $setMethod, $this->entityClassName), 2);
        }

        $this->mapping[$fieldName] = array(
            'getter'    => $getMethod,
            'setter'    => $setMethod,
            'include'   => $include,
            'formatter' => $formatter,
        );

        return $this;
    }
public function addField($fieldName, $getMethod, $setMethod, ByConfigBuilder $include = null, $formatter = null)
    {
        if (method_exists($this->getEntityPrototype(), $getMethod) === false) {
            throw new Exception\ConfigFailed(sprintf($this->exceptions[2], $getMethod, $this->entityClassName), 2);
        }

        if (method_exists($this->getEntityPrototype(), $setMethod) === false) {
            throw new Exception\ConfigFailed(sprintf($this->exceptions[2], $setMethod, $this->entityClassName), 2);
        }

        $this->mapping[$fieldName] = array(
            'getter'    => $getMethod,
            'setter'    => $setMethod,
            'include'   => $include,
            'formatter' => $formatter,
        );

        return $this;
    }
public function addField ( $ fieldName , $ getMethod , $ setMethod , ByConfigBuilder $ include = null , $ formatter = null ) { if ( method_exists ( $ this -> getEntityPrototype ( ) , $ getMethod ) === false ) { throw new Exception \ ConfigFailed ( sprintf ( $ this -> exceptions [ 2 ] , $ getMethod , $ this -> entityClassName ) , 2 ) ; } if ( method_exists ( $ this -> getEntityPrototype ( ) , $ setMethod ) === false ) { throw new Exception \ ConfigFailed ( sprintf ( $ this -> exceptions [ 2 ] , $ setMethod , $ this -> entityClassName ) , 2 ) ; } $ this -> mapping [ $ fieldName ] = array ( 'getter' => $ getMethod , 'setter' => $ setMethod , 'include' => $ include , 'formatter' => $ formatter , ) ; return $ this ; }
Set a mapping

@param  string          $fieldName
@param  string          $getMethod
@param  string          $setMethod
@param  ByConfigBuilder $include
@param  Closure         $formatter

@return $this
Set a mapping