Doctrine\OrientDB\Query\Query::alterProperty PHP Method

alterProperty() public method

Alters the $property of $class setting $sttribute to $value.
public alterProperty ( string $class, string $property, string $attribute, string $value ) : Alter
$class string
$property string
$attribute string
$value string
return Alter
    public function alterProperty($class, $property, $attribute, $value)
    {
        $commandClass = $this->getCommandClass('property.alter');
        $this->command = new $commandClass($property);
        return $this->command->on($class)->changing($attribute, $value);
    }

Usage Example

 /**
  * @depends testCreateProperty
  */
 public function testAlterProperty($class)
 {
     $query = new Query();
     $query->alterProperty($class, 'customTestProperty', 'notnull', 'false');
     $this->assertHttpStatus(204, $this->doQuery($query));
     $query->alterProperty($class, 'customTestProperty', 'notnull', 'true');
     $this->assertHttpStatus(204, $this->doQuery($query));
     return $class;
 }