Open Source Content Management Framework

MidCOM DBA object method get_parent

object get_parent();

Returns the immedate logical parent of the given object. This is very context dependant, so there is no general rule what you object type you will get. If any object does not have a logical parent (like the average MidgardPerson or a top level MidgardTopic), the function returns null.

This function is based on the object get_parent_guid(); helper function. Its results are cached using the memcache backend if it is available. This allows for fast Tree-Traversal without database access as long as it is not needed. Both functions are subject to the DBA level cache and must not be overwritten directly.

While MgdSchema does now provide a get_parent() method implemented on the MgdSchema level, this call is not yet passed through to MidCOM DBA, as the Access Control needed there is not yet in place. The baseclasses currently available in MidCOM core do override it sensibly though, so you shouldn't run into any problems at this point.

When dealing with parent relationships, it is not yet sure that this will be left solely at MgdSchema's hand in the future. The reason for this is that the current PHP level implementation is much more flexible in terms of defining what exactly a parent is. For example, an article's parent is not neccessarily a topic in MidCOM: If you are using the "reply article" feature, that is, articles that have another article as immediate parent, the topic is only the parent of the "first" article in the chain. I'm currently unsure how MgdSchema does/can handle this. But it is important when thinking about privliege inheritance, as privileges inherit "downwards" on this article chain.

< Back to the MidCOM DBA Object API overview

Designed by Nemein, hosted by Anykey