opensupports/server/libs/validations/validOwnersId.php

19 lines
453 B
PHP
Raw Normal View History

2020-01-24 02:26:32 +01:00
<?php
namespace CustomValidations;
use Respect\Validation\Rules\AbstractRule;
class ValidOwnersId extends AbstractRule {
public function validate($owners) {
2020-01-24 19:18:05 +01:00
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;
2020-01-24 02:26:32 +01:00
}
}