Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function others(){
- $group=new Groups();
- $allGroups=$group->fetchAll();
- $groups=array();
- $idGroups=array();
- $detailGroups=new GroupDetails();
- $dGroups=$detailGroups->fetchall();
- $detailGroups->setMember($this->get("Security")->getUser()->getId());
- $memberGroup=$detailGroups->fetch();
- foreach($memberGroup as $gm){
- foreach($dGroups as $gr){
- if($gm->getGroups()==$gr->getGroups() and $gr->getMember()==$this->get("Security")->getUser()->getId()){
- $idGroups[]= $gr->getGroups();
- }
- }
- }
- var_dump($idGroups);
- for($i=0;$i<count($idGroups);$i++){
- foreach($allGroups as $group){
- if(!in_array($group->getId(),$idGroups)){
- $groups[]=$group;
- }
- }
- }
- $this->view('groups','others',compact('groups'));
- }
- ?>
Add Comment
Please, Sign In to add comment