Loading module/Application/src/Application/Controller/AgentController.php +9 −0 Changes for module/Application/src/Application/Controller/AgentController.php: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -105,6 +105,15 @@ class AgentController extends AbstractActionController $agents = $this->getAgentService()->getAgentsWithFiltre($params); } // $jp = $this->getAgentService()->getAgent('8486'); // $jl = $this->getAgentService()->getAgent('13209'); // $tv = $this->getAgentService()->getAgent('16089'); // // $a = ($jp < $jl); // $b = ($jp < $tv); // $array = [$jp, $tv, $jl]; // sort($array); return new ViewModel([ 'agents' => $agents, 'params' => $params, Loading module/Application/src/Application/Entity/Db/Agent.php +12 −1 Changes for module/Application/src/Application/Entity/Db/Agent.php: 12 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Application\Entity\Db; use Application\Provider\Etat\FichePosteEtats; use Carriere\Entity\Db\NiveauEnveloppe; use Doctrine\Common\Comparable; use Element\Entity\Db\Interfaces\HasApplicationCollectionInterface; use Element\Entity\Db\Interfaces\HasCompetenceCollectionInterface; use Application\Entity\Db\Interfaces\HasComplementsInterface; Loading @@ -30,7 +31,8 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; class Agent implements ResourceInterface, HasApplicationCollectionInterface, HasCompetenceCollectionInterface, HasFormationCollectionInterface, HasComplementsInterface HasComplementsInterface, Comparable { use DbImportableAwareTrait; use AgentServiceAwareTrait; Loading Loading @@ -218,6 +220,15 @@ class Agent implements return $this->getDenomination(); } public function compareTo($other) : int { $aaa = $this->getNomUsuel(). '#' . $this->getPrenom() . "#" . $this->id; $bbb = $other->getNomUsuel(). '#' . $other->getPrenom() . "#" . $other->id; if ($aaa > $bbb) return 1; if ($aaa < $bbb) return -1; return 0; } /** * @return string|null */ Loading Loading
module/Application/src/Application/Controller/AgentController.php +9 −0 Changes for module/Application/src/Application/Controller/AgentController.php: 9 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -105,6 +105,15 @@ class AgentController extends AbstractActionController $agents = $this->getAgentService()->getAgentsWithFiltre($params); } // $jp = $this->getAgentService()->getAgent('8486'); // $jl = $this->getAgentService()->getAgent('13209'); // $tv = $this->getAgentService()->getAgent('16089'); // // $a = ($jp < $jl); // $b = ($jp < $tv); // $array = [$jp, $tv, $jl]; // sort($array); return new ViewModel([ 'agents' => $agents, 'params' => $params, Loading
module/Application/src/Application/Entity/Db/Agent.php +12 −1 Changes for module/Application/src/Application/Entity/Db/Agent.php: 12 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ namespace Application\Entity\Db; use Application\Provider\Etat\FichePosteEtats; use Carriere\Entity\Db\NiveauEnveloppe; use Doctrine\Common\Comparable; use Element\Entity\Db\Interfaces\HasApplicationCollectionInterface; use Element\Entity\Db\Interfaces\HasCompetenceCollectionInterface; use Application\Entity\Db\Interfaces\HasComplementsInterface; Loading @@ -30,7 +31,8 @@ use Laminas\Permissions\Acl\Resource\ResourceInterface; class Agent implements ResourceInterface, HasApplicationCollectionInterface, HasCompetenceCollectionInterface, HasFormationCollectionInterface, HasComplementsInterface HasComplementsInterface, Comparable { use DbImportableAwareTrait; use AgentServiceAwareTrait; Loading Loading @@ -218,6 +220,15 @@ class Agent implements return $this->getDenomination(); } public function compareTo($other) : int { $aaa = $this->getNomUsuel(). '#' . $this->getPrenom() . "#" . $this->id; $bbb = $other->getNomUsuel(). '#' . $other->getPrenom() . "#" . $other->id; if ($aaa > $bbb) return 1; if ($aaa < $bbb) return -1; return 0; } /** * @return string|null */ Loading