public function setProperty($name, $value, $persistChanges = true)
    {
        $this->propertiesMetadata[$name] = array("Serializable" => $persistChanges);

        //save property
        $this->{$name} = $value;

        //update resource path
        if ($name === "Id") {
            if (is_null($this->getResourcePath())) {
                if (is_int($value)) {
                    $entityKey = "({$value})";
                } else {
                    $entityKey = "(guid'{$value}')";
                }
                $this->setResourceUrl($this->parentCollection->getResourcePath()->toUrl() . $entityKey);
            }
        }

    }
public function setProperty($name, $value, $persistChanges = true)
    {
        $this->propertiesMetadata[$name] = array("Serializable" => $persistChanges);

        //save property
        $this->{$name} = $value;

        //update resource path
        if ($name === "Id") {
            if (is_null($this->getResourcePath())) {
                if (is_int($value)) {
                    $entityKey = "({$value})";
                } else {
                    $entityKey = "(guid'{$value}')";
                }
                $this->setResourceUrl($this->parentCollection->getResourcePath()->toUrl() . $entityKey);
            }
        }

    }
public function setProperty ( $ name , $ value , $ persistChanges = true ) { $ this -> propertiesMetadata [ $ name ] = array ( "Serializable" => $ persistChanges ) ; //save property $ this -> { $ name } = $ value ; //update resource path if ( $ name === "Id" ) { if ( is_null ( $ this -> getResourcePath ( ) ) ) { if ( is_int ( $ value ) ) { $ entityKey = "({$value})" ; } else { $ entityKey = "(guid'{$value}')" ; } $ this -> setResourceUrl ( $ this -> parentCollection -> getResourcePath ( ) -> toUrl ( ) . $ entityKey ) ; } } }
A preferred way of setting the client object property
@param string $name
@param mixed $value
@param bool $persistChanges
A preferred way of setting the client object property