public function haveTemplate(array $req_templates)
    {
        $templates = new ArrayCollection();

        foreach ($req_templates as $template) {
            if ($template = trim($template) === '') {
                continue;
            }
            if ($templates->contains($template)) {
                continue;
            }
            $templates->add($template);
        }

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

        return $this;
    }
public function haveTemplate(array $req_templates)
    {
        $templates = new ArrayCollection();

        foreach ($req_templates as $template) {
            if ($template = trim($template) === '') {
                continue;
            }
            if ($templates->contains($template)) {
                continue;
            }
            $templates->add($template);
        }

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

        return $this;
    }
public function haveTemplate ( array $ req_templates ) { $ templates = new ArrayCollection ( ) ; foreach ( $ req_templates as $ template ) { if ( $ template = trim ( $ template ) === '' ) { continue ; } if ( $ templates -> contains ( $ template ) ) { continue ; } $ templates -> add ( $ template ) ; } if ( ! $ templates -> isEmpty ( ) ) { $ this -> templates = $ templates ; } return $ this ; }
Restrict users with given templates

@param array $req_templates

@return $this
Restrict users with given templates