public function addPropertyValue(&$entity, $field, $value)
    {
        $container = $this->getPropertyValue($entity, $field, $entity);

        if (!is_array($container)) {
            $container = empty($container) ? [] : [$container];
        }
        $container[] = $value;

        $this->setPropertyValue($entity, $field, $container);
    }
public function addPropertyValue(&$entity, $field, $value)
    {
        $container = $this->getPropertyValue($entity, $field, $entity);

        if (!is_array($container)) {
            $container = empty($container) ? [] : [$container];
        }
        $container[] = $value;

        $this->setPropertyValue($entity, $field, $container);
    }
public function addPropertyValue ( & $ entity , $ field , $ value ) { $ container = $ this -> getPropertyValue ( $ entity , $ field , $ entity ) ; if ( ! is_array ( $ container ) ) { $ container = empty ( $ container ) ? [ ] : [ $ container ] ; } $ container [ ] = $ value ; $ this -> setPropertyValue ( $ entity , $ field , $ container ) ; }
Adds value to array property
If property is not an array - will be converted into one preserving existing value as first element

@param mixed  $entity
@param string $field
@param mixed  $value

@throws AccessorException
Adds value to array property If property is not an array - will be converted into one preserving existing value as first element