public function getEmployeesByRole($role)
    {
        $employees = new ArrayCollection();

        /* @var \Organizations\Entity\Employee $employee */
        foreach ($this->getEmployees() as $employee) {
            if ($role === $employee->getRole()) {
                $employees->add($employee);
            }
        }

        return $employees;
    }
public function getEmployeesByRole($role)
    {
        $employees = new ArrayCollection();

        /* @var \Organizations\Entity\Employee $employee */
        foreach ($this->getEmployees() as $employee) {
            if ($role === $employee->getRole()) {
                $employees->add($employee);
            }
        }

        return $employees;
    }
public function getEmployeesByRole ( $ role ) { $ employees = new ArrayCollection ( ) ; /* @var \Organizations\Entity\Employee $employee */ foreach ( $ this -> getEmployees ( ) as $ employee ) { if ( $ role === $ employee -> getRole ( ) ) { $ employees -> add ( $ employee ) ; } } return $ employees ; }
Gets a list of Employees by a user role

@param string $role

@return ArrayCollection
Gets a list of Employees by a user role