public function setAllowedCategories($categories)
    {
        if (is_string($categories)) {
            $categories = preg_split('/\s*,\s*/', $categories);
        }
        $this->allowedCategories = (array)$categories;
        return $this;
    }
public function setAllowedCategories($categories)
    {
        if (is_string($categories)) {
            $categories = preg_split('/\s*,\s*/', $categories);
        }
        $this->allowedCategories = (array)$categories;
        return $this;
    }
public function setAllowedCategories ( $ categories ) { if ( is_string ( $ categories ) ) { $ categories = preg_split ( '/\s*,\s*/' , $ categories ) ; } $ this -> allowedCategories = ( array ) $ categories ; return $ this ; }
Assign allowed categories

@param array|string $categories
@return $this
Assign allowed categories