public function setData($data)
    {
        $state = $this->getState();
        if ($state == self::STATE_DELETED) {
            throw new Exception\LogicException(__METHOD__ . ": Logic exception, cannot operate on record that was deleted");
        }
        if (is_array($data)) {
            $data = new ArrayObject($data);
        } elseif (! $data instanceof ArrayObject) {
            throw new Exception\InvalidArgumentException(__METHOD__ . ": Data must be an array of an ArrayObject");
        }
        $this->_securedFieldForArrayAccess['data']  = $data;
        $this->setState(self::STATE_DIRTY);
        return $this;
    }
public function setData($data)
    {
        $state = $this->getState();
        if ($state == self::STATE_DELETED) {
            throw new Exception\LogicException(__METHOD__ . ": Logic exception, cannot operate on record that was deleted");
        }
        if (is_array($data)) {
            $data = new ArrayObject($data);
        } elseif (! $data instanceof ArrayObject) {
            throw new Exception\InvalidArgumentException(__METHOD__ . ": Data must be an array of an ArrayObject");
        }
        $this->_securedFieldForArrayAccess['data']  = $data;
        $this->setState(self::STATE_DIRTY);
        return $this;
    }
public function setData ( $ data ) { $ state = $ this -> getState ( ) ; if ( $ state == self :: STATE_DELETED ) { throw new Exception \ LogicException ( __METHOD__ . ": Logic exception, cannot operate on record that was deleted" ) ; } if ( is_array ( $ data ) ) { $ data = new ArrayObject ( $ data ) ; } elseif ( ! $ data instanceof ArrayObject ) { throw new Exception \ InvalidArgumentException ( __METHOD__ . ": Data must be an array of an ArrayObject" ) ; } $ this -> _securedFieldForArrayAccess [ 'data' ] = $ data ; $ this -> setState ( self :: STATE_DIRTY ) ; return $ this ; }
Set record data

@param array|ArrayObject $data
@throws Exception\InvalidArgumentException when the para
@throws Exception\LogicException when the record has been deleted
@return Record
Set record data