Announcement

Collapse
No announcement yet.

getDuplicateWhereClause

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • getDuplicateWhereClause

    Hello,

    who can help : i have the code below :
    my request is :
    if niss is duplicate => stop
    or if firstName and lastName is duplicate => maybe continue.

    Regards


    PHP Code:
    protected function getDuplicateWhereClause(Entity $entity$data)
    {

    $data = [
    'OR' => [
    [
    'firstName' => $entity->get('firstName'),
    'lastName' => $entity->get('lastName'),
    ],
    [
    'niss' => $entity->get('niss'),
    ],
    ],
    ];

    return 
    $data;



    PS : this code result as "Duplicate 409 error" when add "teams" to the record.. :s
Working...
X