Get specify bean without id

Hi everyone

I need your help one more time; I’m trying to get a bean without knowing his id, for this I do the following:

$parameterBean = BeanFactory::getBean('FEC_parametros');
 $beanList = $parameterBean->get_list(
                                'date_entered',
                                "name = 'CRE_CRE_CREDITO_ANALISIS_C'");

This code show in the log this: $beanList --> Array, but I try to get the name property and use:

$name = $beanList->name;

but it doesn’t work.

Please help me.

Best Regards

Hi,
you are quite close:

$accountName = "";
$accountList = BeanFactory::getBean('Accounts')->get_list(
   $order_by = "",
   $where = "accounts.name='test'",
   $row_offset = 0,
   $limit=-1,
   $max=-1,
   $show_deleted = 0);
foreach($accountList['list'] as $account){
    $accountName = $account->name;
}

the last foreach is what you’re missing basically. get_list() does return a nested array, and in ‘list’ you’ll get all the details you need.

Hi diligent

Thanks for all it works