public function setProperties(array $properties, $sync = false)
    {
        $this->properties = [];

        foreach ($properties as $property => $value) {
            $setMethod = 'set' . ucfirst($property);
            if (method_exists($this, $setMethod)) {
                $this->$setMethod($value);
            } else {
                $this->setProperty($property, $value);
            }
        }

        if ($sync) {
            $this->syncOriginal();
        }

        return $this;
    }
public function setProperties(array $properties, $sync = false)
    {
        $this->properties = [];

        foreach ($properties as $property => $value) {
            $setMethod = 'set' . ucfirst($property);
            if (method_exists($this, $setMethod)) {
                $this->$setMethod($value);
            } else {
                $this->setProperty($property, $value);
            }
        }

        if ($sync) {
            $this->syncOriginal();
        }

        return $this;
    }
public function setProperties ( array $ properties , $ sync = false ) { $ this -> properties = [ ] ; foreach ( $ properties as $ property => $ value ) { $ setMethod = 'set' . ucfirst ( $ property ) ; if ( method_exists ( $ this , $ setMethod ) ) { $ this -> $ setMethod ( $ value ) ; } else { $ this -> setProperty ( $ property , $ value ) ; } } if ( $ sync ) { $ this -> syncOriginal ( ) ; } return $ this ; }
Set the array of entity properties.

@param  array $properties
@param  bool $sync
@return $this
Set the array of entity properties .