Get Options for the Select type Attribute is not working for Concrete5 8.0.3

Permalink
I have the following code which is not working when I upgraded my C57 to C58.

$ak = CollectionAttributeKey::getByHandle('directory_category');
$satc = new SelectAttributeTypeController(AttributeType::getByHandle('select'));
$satc->setAttributeKey($ak);
$categories = $satc->getOptions();
$selCategory = explode(',', $category);


I am getting the following error:

Argument 1 passed to Concrete\Core\Attribute\Controller::__construct() must be an instance of Doctrine\ORM\EntityManager, instance of DoctrineProxies\__CG__\Concrete\Core\Entity\Attribute\Type given.

Any help would be greatly Appreciated.

jerryscott
 
hutman replied on at Permalink Reply
hutman
You should be able to do something like this

$selCategory = array();
$ak = CollectionAttributeKey::getByHandle('directory_category');
$akc = $ak->getController();
$categories = $akc->getOptions();
if($categories){
    foreach($categories as $category){
        $selCategory[] = $category->getSelectAttributeOptionDisplayValue();
    }
}