Open Source Content Management Framework

MgdSchema method get_by_path

Description:

$object->get_by_path(string path)

Minimum version: Midgard 1.7

Object may be fecthed from database if its name or any of the object's name in path is empty.

  • "/" only one object in path with empty name
  • "/A/B//D" the third object in path has empty name
  • "/A/B/C/" last (required) object in path has empty name

Get MgdSchema object from the database by path.

$object = new midgard_article();  

$path = "/news/daily/latest";

if ($object->get_by_path($path)) 
{
     print "Object with $path exists";
}

Return FALSE when object is not retrieved and TRUE otherwise.
Follow mgd_errstr() function to get error message on failure.

type must have defined parentfield or upfield in XML Schema file

Designed by Nemein, hosted by Anykey