本文整理汇总了PHP中Illuminate\Database\Eloquent\Collection::getQueueableClass方法的典型用法代码示例。如果您正苦于以下问题:PHP Collection::getQueueableClass方法的具体用法?PHP Collection::getQueueableClass怎么用?PHP Collection::getQueueableClass使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Database\Eloquent\Collection
的用法示例。
在下文中一共展示了Collection::getQueueableClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filterOnMethods
/** After the Eloquent has run on the attributes and returned an eloquent collection,
* this method takes the collection and $querySets as above,
* [$key=>['val'=>$val,'crit'=>$crit,'parm0'=>$parm0.....
* @param Eloquent Collection $collection
* @param array $querySets or null to take from local object
*/
public function filterOnMethods(Collection $collection, $matchObjs=null) {
//pkdebug("Yes, trying to filter.");
if (!$matchObjs || !is_arrayish($matchObjs)) $matchObjs = $this->getMatchObjs();
if (!$matchObjs || !is_arrayish($matchObjs)) return $collection;
$numpre = count($matchObjs);
$modelName = $collection-> getQueueableClass();
//pkdebug("The num of match objs before: The QC is: [ $modelName ], the num $numpre -- is mine here?");
//foreach ($matchObjs as $ma) { if ($ma->compfield == 'assetdebtratio') pkdebug("After buildQS, The MA is: ", $ma); }
$trimmedMatches = PkMatch::filterMatchArr($matchObjs,
['modelName'=>$modelName,'modelMethods'=>true,'emptyCrit'=>true]);
//pkdebug("The Trimmed Match Collection:", $trimmedMatches);
if (!count($trimmedMatches)) return $collection;
$trimmedCollection = $collection->reject(function ($item) use ($trimmedMatches) {
foreach($trimmedMatches as $match) {
$methodName = $match->method;
$methodResult = $item->$methodName();
$passed = $match->satisfy($methodResult);
$reject = !$passed;
if ($reject) return $reject;
} ## Passed all the criteria; don't reject
return false;
});
return $trimmedCollection;
}