category OSS
package OSS_Doctrine2
copyright Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland
license New BSD License

 Methods

Assign values to Doctrine2 entities from an array.

assignFromArray(\Doctrine\ORM\Mapping $entity, array $array, bool $throw) : \Doctrine\ORM\Mapping
Static

The array indexes must match the setter function names less 'set'.

E.g. with array( 'Name' => 'Joe' ) we'd call setName()

Parameters

$entity

\Doctrine\ORM\Mapping

The entity to assign values to

$array

array

The associative array to take values from

$throw

bool

If no setter method exists in the entity for an array index, throw an exception

Exceptions

\OSS_Doctrine2_Exception If $trow param is passed and is true

Returns

\Doctrine\ORM\MappingThe entity as passed for fluent interfaces