Returns true if record with such fields values already exists in current table
Signature
public function checkRecExists(array
$dbFilterArr,
[integer
$excludeRecID = 0,
[boolean
$flushSelectable = true,
[string
$primaryKey = '']]] )
Parameters
$dbFilterArr
—
array
represents structure, like: array($fieldname => array('operator' => $opStr, 'fieldval' => $fldVal, 'cmprlogic' => 'OR' )) where: $opStr - is one of the permitted in MYSQL WHERE clause, like: >, =, <, IS NOT, LIKE, IN, etc $fldVal - represents the field value to compare against 'cmprlogic' - is optional and can contain 'OR' keyword to point the need to use NyanORM's orWhere(). No need to use it for 'AND' logical clause as it is used by DEFAULT and will be ignored
$excludeRecID
—
integer
record ID to make exclusion on (e.g. for finding possible duplicates). For record editing purposes generally.
$flushSelectable
—
boolean
$primaryKey
—
string
name of the table's primary key field
Returns
mixed|string
returns the primary key value(ID usually) if rec found or empty string