/** * Using the Listing's fetchData() method, grab an array of IDs. Depending upon * the selection mode the user has chosen, we may or may not paginate the result * set. * * @param bool $usePagination * @return array */ private function fetchIdsFromListing($usePagination) { $out = []; if (!$usePagination) { $pagination = $this->listing->getSelectModifierByName('SelectPaginate'); $this->listing->removeSelectModifierByName('SelectPaginate'); } foreach ($this->listing->fetchData($this->fields) as $row) { $out[] = $row[$this->listing->getPrimaryKey()->getName()]; } if (!$usePagination && isset($pagination)) { $this->listing->registerSelectModifier($pagination); } return $out; }
public function testCanRetrievePrimaryKeyField() { $this->assertEquals(spl_object_hash($this->model->field('dewdrop_test_fruit_id')), spl_object_hash($this->listing->getPrimaryKey())); }