Bolt\Storage\Query\ContentQueryParser::addOperation PHP Method

addOperation() public method

Adds a new operation to the list supported.
public addOperation ( string $operation )
$operation string name of operation to parse for
    public function addOperation($operation)
    {
        if (!in_array($operation, $this->operations)) {
            $this->operations[] = $operation;
        }
    }

Usage Example

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()));
 }