Skip to content

Commit

Permalink
recordExists() now handle code: identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Mar 19, 2024
1 parent f8f6586 commit e1c42fb
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 81 deletions.
8 changes: 6 additions & 2 deletions src/AbraFlexi/RO.php
Original file line number Diff line number Diff line change
Expand Up @@ -1751,13 +1751,17 @@ public function idExists($identifer = null)
*/
public function recordExists($data = [])
{

if (empty($data)) {
$data = $this->getData();
}
$ignorestate = $this->ignore404();
$this->ignore404(true);
$keyColumn = $this->getKeyColumn();
if(is_string($data) && preg_match('^code:', $data)){
$data = \AbraFlexi\Functions::uncode($data);
$this->keyColumn = 'kod';
} else {
$keyColumn = $this->getKeyColumn();
}
$res = $this->getColumnsFromAbraFlexi(
[$keyColumn],
is_array($data) ? $data : [$keyColumn => $data]
Expand Down
Loading

0 comments on commit e1c42fb

Please sign in to comment.