public function setName($name)
    {
        if ($this->_targetTable !== null) {
            $alias = $this->_targetTable->getAlias();
            if ($alias !== $name) {
                throw new InvalidArgumentException('Association name does not match target table alias.');
            }
        }

        $this->_name = $name;

        return $this;
    }
public function setName($name)
    {
        if ($this->_targetTable !== null) {
            $alias = $this->_targetTable->getAlias();
            if ($alias !== $name) {
                throw new InvalidArgumentException('Association name does not match target table alias.');
            }
        }

        $this->_name = $name;

        return $this;
    }
public function setName ( $ name ) { if ( $ this -> _targetTable !== null ) { $ alias = $ this -> _targetTable -> getAlias ( ) ; if ( $ alias !== $ name ) { throw new InvalidArgumentException ( 'Association name does not match target table alias.' ) ; } } $ this -> _name = $ name ; return $ this ; }
Sets the name for this association, usually the alias
assigned to the target associated table

@param string $name Name to be assigned
@return $this
Sets the name for this association usually the alias assigned to the target associated table