public function indexOf($item) { $c = $this->getCount(); for ($i = 0; $i < $c; ++$i) { if ($this->itemAt($i) === $item) { return $i; } } return -1; }
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)); }