Hello,
I have the following code with the goal to retrieve, from a ProspectList all accounts that has no email sent in the current month:
$accounts_bean = BeanFactory::getBean('ProspectLists','$id_ProspectLists')->get_linked_beans('accounts', 'Account');
foreach($accounts_bean as $account){
$account->load_relationship('emails');
$emails = $account->emails->getBeans(array(
'where' => array(
'lhs_field' => 'type',
'operator' => '=',
'rhs_value' => 'out'
),
'and' => array(
array(
'lhs_field' => 'status',
'operator' => '=',
'rhs_value' => 'sent'
),
array(
'lhs_field' => 'MONTH(date_sent_received)',
'operator' => '<>',
'rhs_value' => 'MONTH(CURRENT_TIMESTAMP)'
)
)
));
}
As per topic title, how can I pass multiple where params to getBeans() function, if it pretends only one array like the following?
array(
'where' => array(
'lhs_field' => 'type',
'operator' => '=',
'rhs_value' => 'out'
)
)
Am I misunderstanding something or the function can filters on only one field?
Any helps are appreciated. Thank you.