src/Model/Struct.php
public function addAttribute($attributeName, $attributeType)
    {
        if (empty($attributeName) || empty($attributeType)) {
            throw new \InvalidArgumentException(sprintf('Attribute name "%s" and/or attribute type "%s" is invalid for Struct "%s"', $attributeName, $attributeType, $this->getName()), __LINE__);
        }
        if ($this->attributes->getStructAttributeByName($attributeName) === null) {
            $structAttribute = new StructAttribute($this->getGenerator(), $attributeName, $attributeType, $this);
            $this->attributes->add($structAttribute);
        }
        return $this;
    }
public function addAttribute($attributeName, $attributeType)
    {
        if (empty($attributeName) || empty($attributeType)) {
            throw new \InvalidArgumentException(sprintf('Attribute name "%s" and/or attribute type "%s" is invalid for Struct "%s"', $attributeName, $attributeType, $this->getName()), __LINE__);
        }
        if ($this->attributes->getStructAttributeByName($attributeName) === null) {
            $structAttribute = new StructAttribute($this->getGenerator(), $attributeName, $attributeType, $this);
            $this->attributes->add($structAttribute);
        }
        return $this;
    }
public function addAttribute ( $ attributeName , $ attributeType ) { if ( empty ( $ attributeName ) || empty ( $ attributeType ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Attribute name "%s" and/or attribute type "%s" is invalid for Struct "%s"' , $ attributeName , $ attributeType , $ this -> getName ( ) ) , __LINE__ ) ; } if ( $ this -> attributes -> getStructAttributeByName ( $ attributeName ) === null ) { $ structAttribute = new StructAttribute ( $ this -> getGenerator ( ) , $ attributeName , $ attributeType , $ this ) ; $ this -> attributes -> add ( $ structAttribute ) ; } return $ this ; }
Adds attribute based on its original name
@throws \InvalidArgumentException
@param string $attributeName the attribute name
@param string $attributeType the attribute type
@return Struct
Adds attribute based on its original name