seach valid staff to validownersid

This commit is contained in:
Guillermo Giuliana 2020-01-24 15:18:05 -03:00
parent 46ca19c2cc
commit f4b3ea2a65

View File

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