Beispiel #1
0
    /**
     * Creates a new instance of this command setting the index to insert into,
     * the key of the new entry and its value, which is a RID.
     *
     * @param string $indexName
     * @param string $key
     * @param string $rid 
     */
    public function __construct($indexName, $key, $rid)
    {
        parent::__construct();

        $this->setToken('Name', $indexName);
        $this->setToken('Key', $key);
        $this->setToken('Value', $rid);
    }
Beispiel #2
0
    /**
     * Creates a new statements to manage indexes on the $property of the given
     * $class.
     *
     * @param string $property
     * @param string $class
     */
    public function __construct($property, $class = null)
    {
        parent::__construct();

        if ($class) {
            $this->setToken('IndexClass', $class);
        }

        $this->setToken('Property', $property);
    }
Beispiel #3
0
    public function __construct($indexName, $key, $rid = null, TokenFormatter $ridFormatter = null)
    {
        parent::__construct();

        $ridFormatter = $ridFormatter ?: new EmbeddedRidFormatter;
        $this->setToken('Name', $indexName);

        if (!is_null($key)) {
          $this->where("key = ?", $key);
        }

        if ($rid) {
            $method = $key ? 'andWhere' : 'where';
            $rid    = $ridFormatter::format(array($rid));
            $this->$method("rid = $rid");
        }
    }
Beispiel #4
0
    /**
     * Sets the $property to index.
     * Optionally, you can specify the property $class and the $type of the
     * index.
     *
     * @param string $property
     * @param string $class
     * @param string $type
     */
    public function __construct($indexName)
    {
        parent::__construct();

        $this->setToken('Name', $indexName);
    }
Beispiel #5
0
    /**
     * Builds a new statement, setting the $index to lookup.
     *
     * @param string $index
     */
    public function __construct($index)
    {
        parent::__construct();

        $this->setToken('Index', $index);
    }