protected function execute($value, EntityInterface $entity = null)
    {
        $success = true;
        $collection = null;

        if ($value instanceof EntityList) {
            $collection = $value;
        } elseif (null === $value) {
            $collection = new EntityList();
        } elseif (is_array($value)) {
            $collection = $this->createEntityList($value);
        } else {
            $this->throwError('invalid_type');
            $success = false;
        }

        if ($success) {
            $this->setSanitizedValue($collection);
        }

        return $success;
    }
protected function execute($value, EntityInterface $entity = null)
    {
        $success = true;
        $collection = null;

        if ($value instanceof EntityList) {
            $collection = $value;
        } elseif (null === $value) {
            $collection = new EntityList();
        } elseif (is_array($value)) {
            $collection = $this->createEntityList($value);
        } else {
            $this->throwError('invalid_type');
            $success = false;
        }

        if ($success) {
            $this->setSanitizedValue($collection);
        }

        return $success;
    }
protected function execute ( $ value , EntityInterface $ entity = null ) { $ success = true ; $ collection = null ; if ( $ value instanceof EntityList ) { $ collection = $ value ; } elseif ( null === $ value ) { $ collection = new EntityList ( ) ; } elseif ( is_array ( $ value ) ) { $ collection = $ this -> createEntityList ( $ value ) ; } else { $ this -> throwError ( 'invalid_type' ) ; $ success = false ; } if ( $ success ) { $ this -> setSanitizedValue ( $ collection ) ; } return $ success ; }
Valdiates and sanitizes a given value respective to the reference-valueholder's expectations.

@param mixed $value The types 'array' and 'EntityList' are accepted.

@return boolean
Valdiates and sanitizes a given value respective to the reference - valueholder s expectations .