Class midcom_db_topic

Description

MidCOM Legacy Database Abstraction Layer

This class encapsulates a classic MidgardTopic with its original features.

Preliminary Implementation:

Be aware that this implementation is incomplete, and grows on a is-needed basis.

Located in /midcom.core/midcom/db/topic.php (line 22)

__midcom_baseclasses_database_topic
   |
   --midcom_baseclasses_database_topic
      |
      --midcom_db_topic
Method Summary
static void new_query_builder ()
midcom_db_topic __construct ([mixed $id = null])
boolean is_in_tree (mixed $topic)
Array list_articles ([string $sort = null])
Methods
static method new_query_builder (line 45)

Overwrite the query builder getter with a version retrieving the right type.

We need a better solution here in DBA core actually, but it will be difficult to do this as we cannot determine the current class in a polymorphic environment without having a this (this call is static).

static void new_query_builder ()
Constructor __construct (line 32)

The default constructor will create an empty object. Optionally, you can pass an object ID or GUID to the object which will then initialize the object with the corresponding DB instance.

midcom_db_topic __construct ([mixed $id = null])
  • mixed $id: A valid object ID or GUID, omit for an empty object.

Redefinition of:
midcom_baseclasses_database_topic::__construct()
get_list_articles_qb (line 83)

Returns a query builder suitable to list articles within a topic.

A get_list_articles_qb ()
is_in_tree (line 99)

Checks whether the topic is part of the subtree of a given topic. A topic is always in his own tree, so $this->is_in_tree($this) will be true.

This wraps http://www.midgard-project.org/documentation/mgdschema-method-is_in_tree/

  • return: True if Member.
boolean is_in_tree (mixed $topic)
  • mixed $topic: Either the ID, GUID or object instance of the base topic.
list_articles (line 59)

Lists all articles in the corresponding topic. All reply articles are filtered by default to match original Midgard behavior.

Array list_articles ([string $sort = null])
  • string $sort: A legacy sorting order string.

Inherited Methods

Inherited From midcom_baseclasses_database_topic

midcom_baseclasses_database_topic::__construct()
midcom_baseclasses_database_topic::get_dba_parent_class()
midcom_baseclasses_database_topic::get_parent_guid_uncached()
midcom_baseclasses_database_topic::get_parent_guid_uncached_static()
midcom_baseclasses_database_topic::_get_parent_guid_uncached_static_topic()
midcom_baseclasses_database_topic::_on_created()
midcom_baseclasses_database_topic::_on_updated()

Documentation generated on Fri, 10 Oct 2008 22:11:46 +0300 by phpDocumentor 1.4.2