protected function bindData($data)
    {
        $dataClass = $this->dataClass;
        $object = new $dataClass();

        if ($object instanceof DataInterface) {
            return $object->bind($data);
        }

        foreach ((array) $data as $field => $value) {
            $object->$field = $value;
        }

        return $object;
    }
protected function bindData($data)
    {
        $dataClass = $this->dataClass;
        $object = new $dataClass();

        if ($object instanceof DataInterface) {
            return $object->bind($data);
        }

        foreach ((array) $data as $field => $value) {
            $object->$field = $value;
        }

        return $object;
    }
protected function bindData ( $ data ) { $ dataClass = $ this -> dataClass ; $ object = new $ dataClass ( ) ; if ( $ object instanceof DataInterface ) { return $ object -> bind ( $ data ) ; } foreach ( ( array ) $ data as $ field => $ value ) { $ object -> $ field = $ value ; } return $ object ; }
Bind a record into data.

@param mixed $data The data we want to bind.

@return  object

@throws \UnexpectedValueException
Bind a record into data .