public function setAttributeList($attributeList): self
    {
        $this->attributeList = [];

        foreach ($attributeList as $attribute) {
            $this->attributeList[$attribute->getSerializedKey()] = $attribute;

            if ($attribute->isIdentifier()) {
                if ($this->identifierAttribute) {
                    throw new MoreThanOneIdentifierException(
                        sprintf(
                            'Class metadata for model "%s" already has an identifier named "%s". Only one identifier is allowed.',
                            $this->modelName,
                            $this->identifierAttribute->getSerializedKey()
                        )
                    );
                }

                $this->identifierAttribute = $attribute;
            }
        }

        return $this;
    }
public function setAttributeList($attributeList): self
    {
        $this->attributeList = [];

        foreach ($attributeList as $attribute) {
            $this->attributeList[$attribute->getSerializedKey()] = $attribute;

            if ($attribute->isIdentifier()) {
                if ($this->identifierAttribute) {
                    throw new MoreThanOneIdentifierException(
                        sprintf(
                            'Class metadata for model "%s" already has an identifier named "%s". Only one identifier is allowed.',
                            $this->modelName,
                            $this->identifierAttribute->getSerializedKey()
                        )
                    );
                }

                $this->identifierAttribute = $attribute;
            }
        }

        return $this;
    }
public function setAttributeList ( $ attributeList ) : self { $ this -> attributeList = [ ] ; foreach ( $ attributeList as $ attribute ) { $ this -> attributeList [ $ attribute -> getSerializedKey ( ) ] = $ attribute ; if ( $ attribute -> isIdentifier ( ) ) { if ( $ this -> identifierAttribute ) { throw new MoreThanOneIdentifierException ( sprintf ( 'Class metadata for model "%s" already has an identifier named "%s". Only one identifier is allowed.' , $ this -> modelName , $ this -> identifierAttribute -> getSerializedKey ( ) ) ) ; } $ this -> identifierAttribute = $ attribute ; } } return $ this ; }
Setter for attributeList

@param  iterable<Attribute> $attributeList
Setter for attributeList