protected function prepareDataForEntity(array $data)
    {
        /**
         * @var \Everon\DataMapper\Interfaces\Schema\Column $Column
         */
        foreach ($this->getMapper()->getTable()->getColumns() as $name => $Column) {
            if (array_key_exists($name, $data) === false) {
                if ($Column->isPk()) {
                    $data[$name] = null;
                }
                else if ($Column->isNullable() === false) {
                    throw new Exception\Domain('Missing Entity data: "%s" for "%s"', [$name, $this->getMapper()->getTable()->getName()]);
                }
                
                $data[$name] = null;
            }
            
            $data[$name] = $Column->getColumnDataForEntity($data[$name]);
        }

        return $data;
    }
protected function prepareDataForEntity(array $data)
    {
        /**
         * @var \Everon\DataMapper\Interfaces\Schema\Column $Column
         */
        foreach ($this->getMapper()->getTable()->getColumns() as $name => $Column) {
            if (array_key_exists($name, $data) === false) {
                if ($Column->isPk()) {
                    $data[$name] = null;
                }
                else if ($Column->isNullable() === false) {
                    throw new Exception\Domain('Missing Entity data: "%s" for "%s"', [$name, $this->getMapper()->getTable()->getName()]);
                }
                
                $data[$name] = null;
            }
            
            $data[$name] = $Column->getColumnDataForEntity($data[$name]);
        }

        return $data;
    }
protected function prepareDataForEntity ( array $ data ) { /**
         * @var \Everon\DataMapper\Interfaces\Schema\Column $Column
         */ foreach ( $ this -> getMapper ( ) -> getTable ( ) -> getColumns ( ) as $ name => $ Column ) { if ( array_key_exists ( $ name , $ data ) === false ) { if ( $ Column -> isPk ( ) ) { $ data [ $ name ] = null ; } else if ( $ Column -> isNullable ( ) === false ) { throw new Exception \ Domain ( 'Missing Entity data: "%s" for "%s"' , [ $ name , $ this -> getMapper ( ) -> getTable ( ) -> getName ( ) ] ) ; } $ data [ $ name ] = null ; } $ data [ $ name ] = $ Column -> getColumnDataForEntity ( $ data [ $ name ] ) ; } return $ data ; }
Makes sure data defined in the Entity is in proper format and all keys are set

@param array $data
@return array
@throws \Everon\Exception\Domain
Makes sure data defined in the Entity is in proper format and all keys are set