21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 537 Views |
-
obtain objects of a class

13 August 2011 at 6:06pm
Hi all.
Would be like to obtain the objects of a particular class only and not all are of the same class
is for use as dropdownfield options.
I'm using DataObject:: get ('class') and this works but selects all classes and I just need this particular
-
Re: obtain objects of a class

17 August 2011 at 10:38pm
something like...
$dos = DataObject::get('class');
foreach ($dos as $do) {
if (!in_array($do->ClassName,array('class1','class2'))) {
$dos->remove($do);
}
}
$map = $dos ? $dos->toDropdownMap() : array();
$df = new DropdownField($strFieldName,$strLabel,$map);
| 537 Views | ||
|
Page:
1
|
Go to Top |


