Retrieve the id of a record
How to proceed to retrieve id of a record ?
Each collector can call the method getId that allows you to retrieve the id of a record.
function getId($primary_key_value = ", $order = ", $limit = ", $offset = ", $tables = ", $join = ") { }
Settings
- $primary_key_value : the value of the primary key OR a table that includes the retrieval conditions ($conditions).
- $order : the name of a field on which to perform a sort by order ascending.
- $limit : a number that will determine the maximum number of results.
- $offset : a number that will determine the starting point of the results.
- $tables : a table with the names of the tables on which one wishes to perform joins.
- $join : the joins themselves.
Example
The following example allows you to retrieve the id of a record from the collector "example" when the field "lib" is equal to "Item 3".
$conditions = array('lib' => 'Item 3');
$result = $this->collector['example']->getId($conditions);
The function's return
This method returns an identifier.