public function addAttribute(AttributeInterface $attribute)
    {
        if (!$this
            ->attributes
            ->contains($attribute)) {
            $this
                ->attributes
                ->add($attribute);
        }

        return $this;
    }
public function addAttribute(AttributeInterface $attribute)
    {
        if (!$this
            ->attributes
            ->contains($attribute)) {
            $this
                ->attributes
                ->add($attribute);
        }

        return $this;
    }
public function addAttribute ( AttributeInterface $ attribute ) { if ( ! $ this -> attributes -> contains ( $ attribute ) ) { $ this -> attributes -> add ( $ attribute ) ; } return $ this ; }
Adds an attribute if not already in the collection.

@param AttributeInterface $attribute Attribute

@return $this Self object
Adds an attribute if not already in the collection .