seach valid staff to validownersid

This commit is contained in:
Guillermo Giuliana 2020-01-24 15:18:05 -03:00
parent 46ca19c2cc
commit f4b3ea2a65
1 changed files with 8 additions and 10 deletions

View File

@ -7,15 +7,13 @@ use Respect\Validation\Rules\AbstractRule;
class ValidOwnersId extends AbstractRule {
public function validate($owners) {
if(is_array(json_decode($owners))){
foreach (json_decode($owners) as $owner) {
$author = \Ticket::getDataStore($owner, "owner_id");
if($author->isNull()) return false;
}
return true;
}
return false;
if(is_array(json_decode($owners))){
foreach (json_decode($owners) as $owner) {
$author = \Staff::getDataStore($owner);
if($author->isNull()) return false;
}
return true;
}
return false;
}
}