public function setAttribute($name, $config = array())
    {
        $attributes = is_string($name) ? array($name => $config) : $name;
        $property = null;
        foreach ($attributes as $name => $config) {
            if (is_numeric($name)) {
                $name = $config;
                $config = array();
            } elseif (is_string($config)) {
                $config = array('column' => $config);
            }

            $config['name'] = pick($this->getAlias($name), $name);
            $config['description'] = $this;
            $property = AnDomainProperty::setAttribute(new AnConfig($config));
        }

        return $property;
    }
public function setAttribute($name, $config = array())
    {
        $attributes = is_string($name) ? array($name => $config) : $name;
        $property = null;
        foreach ($attributes as $name => $config) {
            if (is_numeric($name)) {
                $name = $config;
                $config = array();
            } elseif (is_string($config)) {
                $config = array('column' => $config);
            }

            $config['name'] = pick($this->getAlias($name), $name);
            $config['description'] = $this;
            $property = AnDomainProperty::setAttribute(new AnConfig($config));
        }

        return $property;
    }
public function setAttribute ( $ name , $ config = array ( ) ) { $ attributes = is_string ( $ name ) ? array ( $ name => $ config ) : $ name ; $ property = null ; foreach ( $ attributes as $ name => $ config ) { if ( is_numeric ( $ name ) ) { $ name = $ config ; $ config = array ( ) ; } elseif ( is_string ( $ config ) ) { $ config = array ( 'column' => $ config ) ; } $ config [ 'name' ] = pick ( $ this -> getAlias ( $ name ) , $ name ) ; $ config [ 'description' ] = $ this ; $ property = AnDomainProperty :: setAttribute ( new AnConfig ( $ config ) ) ; } return $ property ; }
Set an attribute or attributes property. It is possible to set an set of attributes by
passing an array as the name.

@param string $name   The name of the attributes or an array of name/option value
@param array  $config The attribute options

@return AnDomainAttributeAbstract
Set an attribute or attributes property . It is possible to set an set of attributes by passing an array as the name .