protected function setProperties(array $properties = [])
    {
        foreach ($properties as $name => $value) {
            // set property
            if (property_exists($this, $name)) {
                $this->$name = $value;

            // unknown property found
            } else {
                trigger_error(
                    sprintf(
                        'unknown property "%s" for "%s"',
                        $name,
                        get_class($this)
                    ),
                    E_USER_WARNING
                );
            }
        }
    }
protected function setProperties(array $properties = [])
    {
        foreach ($properties as $name => $value) {
            // set property
            if (property_exists($this, $name)) {
                $this->$name = $value;

            // unknown property found
            } else {
                trigger_error(
                    sprintf(
                        'unknown property "%s" for "%s"',
                        $name,
                        get_class($this)
                    ),
                    E_USER_WARNING
                );
            }
        }
    }
protected function setProperties ( array $ properties = [ ] ) { foreach ( $ properties as $ name => $ value ) { // set property if ( property_exists ( $ this , $ name ) ) { $ this -> $ name = $ value ; // unknown property found } else { trigger_error ( sprintf ( 'unknown property "%s" for "%s"' , $ name , get_class ( $ this ) ) , E_USER_WARNING ) ; } } }
Set properties, trigger warning if unknown property found

@param  array $properties (optional) object properties
@access protected
Set properties trigger warning if unknown property found