<?php
namespace ModulesAbstract\FluxRest\Response; class Main { public $operations= []; public $responseHandling = "default"; public function appendOperation($operation) { $this->operations[]= $operation; return $this; } public function clearOperations() { $this->operations = []; return $this; } public function hasOperations() { return (bool)$this->operations; } public function filterOperations($callback) { return array_filter($this->operations, $callback); } public function hasOperation($operationId) { return (bool)$this->countOperation($operationId); } public function countOperation($operationId) { return count($this->filterOperations(function(\ModulesAbstract\FluxRest\Response\Operation\OperationAbstract $op) use($operationId) { return $operationId == $op->action; })); } } 