Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Data Model Questions

Detecting DataList Type


Reply

2 Posts   270 Views

Avatar
codepattern

5 May 2014 at 3:21pm Community Member, 8 Posts

This is probably some thing fairly easy but I can't wrap my mind around it. I am trying to put some condition based on whether a datalist is a HasManyList ot ManyManyList. For example, my debug output has ...

-----
ManyManyList

ClassName =

Image

Created =

2014-01-22 00:39:28

..etc

How do I figure out if the list is a ManyManyList or a HasManyList such as

if(ManyManyList) ...

elseif (HasManyList) ...

Thanks in advance

Avatar
simon_w

5 May 2014 at 4:05pm Forum Moderator, 474 Posts

if ($list instanceof ManyManyList) {

} else if($list instanceof HasManyList) {

}