Symfony\Component\Form\PropertyPath::isIndex PHP Method

isIndex() public method

Returns whether the element at the given index is an array index
public isIndex ( integer $index ) : boolean
$index integer The index in the property path
return boolean Whether the element at this index is an array index
    public function isIndex($index)
    {
        return $this->isIndex[$index];
    }

Usage Example

Esempio n. 1
0
 public function testValidPropertyPath()
 {
     $path = new PropertyPath('reference.traversable[index].property');
     $this->assertEquals('reference', $path->getCurrent());
     $this->assertTrue($path->hasNext());
     $this->assertTrue($path->isProperty());
     $this->assertFalse($path->isIndex());
     $path->next();
     $this->assertEquals('traversable', $path->getCurrent());
     $this->assertTrue($path->hasNext());
     $this->assertTrue($path->isProperty());
     $this->assertFalse($path->isIndex());
     $path->next();
     $this->assertEquals('index', $path->getCurrent());
     $this->assertTrue($path->hasNext());
     $this->assertFalse($path->isProperty());
     $this->assertTrue($path->isIndex());
     $path->next();
     $this->assertEquals('property', $path->getCurrent());
     $this->assertFalse($path->hasNext());
     $this->assertTrue($path->isProperty());
     $this->assertFalse($path->isIndex());
 }
All Usage Examples Of Symfony\Component\Form\PropertyPath::isIndex