Open Source Content Management System

MgdSchema in PHP

  1. User-Defined Classes
    1. Constructor
    2. Methods:
      1. Basic Methods
      2. Methods to Fetch Object Record(s) from the Database
      3. Tree Methods
      4. Multilingual Methods
      5. Extending objects ( since 1.9 )
      6. Events ( since 1.9 )
      7. Routines and helpers
  2. Midgard Core Classes
      1. Reflection
      2. Metadata
      3. Midgard Collector
      4. Midgard Replicator
      5. Midgard Blob

The features described in this part of documentation are still in experimental state and may change in future Midgard releases.

MgdSchema classes are registered as internal PHP classes with default properties set. To make new object instances follow the PHP documentation. The list of loaded MgdSchema types is available in the $_MIDGARD superglobal.

Since Midgard 1.8 every MgdSchema object provides midgard_metadata object.

The Midgard Reflection Property API is available for midgard-php developers.

To query MgdSchema objects stored in the Midgard database, use the Query Builder.

Error handling

User-Defined Classes

Constructor

MgdSchema in PHP - Object constructor

Methods:

Basic Methods

  • create - Create a new record in the database
  • delete - Delete record(s) from the database
  • update - Update a record in the database
  • undelete - Undelete a record in the database

Methods to Fetch Object Record(s) from the Database

  • find - Fetch record(s) from the database according to properties being set
  • get - Fetch a record from the database according to properties being set
  • get_by_id - Fetch a record from the database
  • get_by_guid - Fetch a record from the database
  • get_by_path - Fetch a record from the database

Tree Methods

  • get_parent - Fetch the parent class record from the database
  • is_in_parent_tree - Check if a record is in a particular tree hierarchy of objects of any class
  • is_in_tree - Check if a record is in a tree hierarchy of objects of same class
  • list - Fetch object records (of the same type) from the database
  • list_children - Fetch child object records from the database
  • parent - Get the parent (in tree) class name

Multilingual Methods

  • get_languages - Fetch midgard_language objects for which object's content exists.

Extending objects ( since 1.9 )

Events ( since 1.9 )

  • connect - Connects to event
  • emit - Emits an event

Routines and helpers

  • new_query_builder - Create Query Builder instance
  • new_collector - Create Collector instance
  • new_reflection_property - Create Reflection Property instance

Midgard Core Classes

Reflection

Metadata

Midgard Collector

Midgard Replicator

Midgard Blob

Designed by Nemein, hosted by Anykey