public function haveActivities(array $req_activities)
    {
        $activities = new ArrayCollection();

        foreach ($req_activities as $activity) {
            if ($activity = trim($activity) === '') {
                continue;
            }

            if ($activities->contains($activity)) {
                continue;
            }

            $activities->add($activity);
        }

        if (!$activities->isEmpty()) {
            $this->activities = $activities;
        }

        return $this;
    }
public function haveActivities(array $req_activities)
    {
        $activities = new ArrayCollection();

        foreach ($req_activities as $activity) {
            if ($activity = trim($activity) === '') {
                continue;
            }

            if ($activities->contains($activity)) {
                continue;
            }

            $activities->add($activity);
        }

        if (!$activities->isEmpty()) {
            $this->activities = $activities;
        }

        return $this;
    }
public function haveActivities ( array $ req_activities ) { $ activities = new ArrayCollection ( ) ; foreach ( $ req_activities as $ activity ) { if ( $ activity = trim ( $ activity ) === '' ) { continue ; } if ( $ activities -> contains ( $ activity ) ) { continue ; } $ activities -> add ( $ activity ) ; } if ( ! $ activities -> isEmpty ( ) ) { $ this -> activities = $ activities ; } return $ this ; }
Restrict users with provided activities

@param array $req_activities

@return $this
Restrict users with provided activities