Prado\Collections\TPagedList::indexOf PHP 메소드

indexOf() 공개 메소드

public indexOf ( $item ) : integer
리턴 integer the index of the item in the list (0 based), -1 if not found.
    public function indexOf($item)
    {
        $c = $this->getCount();
        for ($i = 0; $i < $c; ++$i) {
            if ($this->itemAt($i) === $item) {
                return $i;
            }
        }
        return -1;
    }

Usage Example

예제 #1
0
 public function testIndexOf()
 {
     $list = new TPagedList(array(1, 2, 3));
     $list->CustomPaging = true;
     self::assertEquals(0, $list->indexOf(1));
     self::assertEquals(-1, $list->indexOf(0));
 }