public function hashToFieldValue($fieldValue, array $context = array())
    {
        $authors = array();

        /// @deprecated
        if (isset($fieldValue['authors'])) {
            foreach ($fieldValue['authors'] as $author) {
                $author = $this->referenceResolver->resolveReference($author);
                $authors[] = new Author($author);
            }
        } else if (is_array($fieldValue)) {
            /// same as what fromHash() does, really
            foreach ($fieldValue as $author) {
                $author = $this->referenceResolver->resolveReference($author);
                $authors[] = new Author($author);
            }
        }

        return new AuthorValue($authors);
    }
public function hashToFieldValue($fieldValue, array $context = array())
    {
        $authors = array();

        /// @deprecated
        if (isset($fieldValue['authors'])) {
            foreach ($fieldValue['authors'] as $author) {
                $author = $this->referenceResolver->resolveReference($author);
                $authors[] = new Author($author);
            }
        } else if (is_array($fieldValue)) {
            /// same as what fromHash() does, really
            foreach ($fieldValue as $author) {
                $author = $this->referenceResolver->resolveReference($author);
                $authors[] = new Author($author);
            }
        }

        return new AuthorValue($authors);
    }
public function hashToFieldValue ( $ fieldValue , array $ context = array ( ) ) { $ authors = array ( ) ; /// @deprecated if ( isset ( $ fieldValue [ 'authors' ] ) ) { foreach ( $ fieldValue [ 'authors' ] as $ author ) { $ author = $ this -> referenceResolver -> resolveReference ( $ author ) ; $ authors [ ] = new Author ( $ author ) ; } } else if ( is_array ( $ fieldValue ) ) { /// same as what fromHash() does, really foreach ( $ fieldValue as $ author ) { $ author = $ this -> referenceResolver -> resolveReference ( $ author ) ; $ authors [ ] = new Author ( $ author ) ; } } return new AuthorValue ( $ authors ) ; }
Creates a value object to use as the field value when setting an author field type.

@param array $fieldValue The definition of the field value, structured in the yml file
@param array $context The context for execution of the current migrations. Contains f.e. the path to the migration
@return AuthorValue
Creates a value object to use as the field value when setting an author field type .