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);
            }
        } else {
            if ('_' == substr($property, 0, 1)) {
                throw new AnObjectException("Protected or private properties can't be set outside of object scope in ".get_class($this));
            }

            $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);
            }
        } else {
            if ('_' == substr($property, 0, 1)) {
                throw new AnObjectException("Protected or private properties can't be set outside of object scope in ".get_class($this));
            }

            $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 ) ; } } else { if ( '_' == substr ( $ property , 0 , 1 ) ) { throw new AnObjectException ( "Protected or private properties can't be set outside of object scope in " . get_class ( $ this ) ) ; } $ this -> $ property = $ value ; } return $ this ; }
Set the object properties

@param   string|array|object $property The name of the property, an associative array or an object
@param   mixed               $value    The value of the property
@throws  AnObjectException If trying to access protected or private properties
@return  AnObject
Set the object properties