Bolt\Storage\Query\ContentQueryParser::removeOperation PHP Метод

removeOperation() публичный Метод

Removes an operation from the list supported.
public removeOperation ( string $operation )
$operation string name of operation to remove
    public function removeOperation($operation)
    {
        if (in_array($operation, $this->operations)) {
            $key = array_search($operation, $this->operations);
            unset($this->operations[$key]);
        }
    }

Usage Example

Пример #1
0
 public function testRemoveOperation()
 {
     $app = $this->getApp();
     $qb = new ContentQueryParser($app['storage'], $app['query.select']);
     $qb->addOperation('featured');
     $this->assertTrue(in_array('featured', $qb->getOperations()));
     $qb->removeOperation('featured');
     $this->assertFalse(in_array('featured', $qb->getOperations()));
 }