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

  1. $primary_key_value : the value of the primary key OR a table that includes the retrieval conditions ($conditions).
  2. $order : the name of a field on which to perform a sort by order ascending.
  3. $limit : a number that will determine the maximum number of results.
  4. $offset : a number that will determine the starting point of the results.
  5. $tables : a table with the names of the tables on which one wishes to perform joins.
  6. $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.