public function set($property, $value = null)
    {
        if (is_object($property)) {
            $property = get_object_vars($property);
        }

        if (is_array($property)) {
            foreach ($property as $k => $v) {
                $this->set($k, $v);
            }
        } elseif ('_' != substr($property, 0, 1)) {
            if (method_exists($this, 'set'.ucfirst($property))) {
                $this->{'set'.ucfirst($property)}($value);
            } else {
                $this->$property = $value;
            }
        }

        return $this;
    }
public function set($property, $value = null)
    {
        if (is_object($property)) {
            $property = get_object_vars($property);
        }

        if (is_array($property)) {
            foreach ($property as $k => $v) {
                $this->set($k, $v);
            }
        } elseif ('_' != substr($property, 0, 1)) {
            if (method_exists($this, 'set'.ucfirst($property))) {
                $this->{'set'.ucfirst($property)}($value);
            } else {
                $this->$property = $value;
            }
        }

        return $this;
    }
public function set ( $ property , $ value = null ) { if ( is_object ( $ property ) ) { $ property = get_object_vars ( $ property ) ; } if ( is_array ( $ property ) ) { foreach ( $ property as $ k => $ v ) { $ this -> set ( $ k , $ v ) ; } } elseif ( '_' != substr ( $ property , 0 , 1 ) ) { if ( method_exists ( $ this , 'set' . ucfirst ( $ property ) ) ) { $ this -> { 'set' . ucfirst ( $ property ) } ( $ value ) ; } else { $ this -> $ property = $ value ; } } return $ this ; }
Set the object properties.

@param   string|array|object The name of the property, an associative array or an object
@param   mixed               The value of the property

@throws AnObjectException

@return AnObject
Set the object properties .