本文整理匯總了PHP中entity::join方法的典型用法代碼示例。如果您正苦於以下問題:PHP entity::join方法的具體用法?PHP entity::join怎麽用?PHP entity::join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類entity
的用法示例。
在下文中一共展示了entity::join方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: store
<?php
require_once 'lib/dbo.php';
//require_once('lib/mysqli.php');
//require_once('lib/mysql.php');
require_once 'lib/pgsql.php';
$store = new store('dave', 'dave');
$people = new entity($store, 'people', 'dave');
$location = new entity($store, 'location', 'dave');
$places = new entity($store, 'places', 'dave');
$j1 = $location->join($people, array('person' => 'id'));
try {
$j2 = $j1->join($places, array('place' => 'id'));
} catch (exception $e) {
echo $e->getMessage() . "\n";
}
$j3 = $places->join($j1, array('id' => 'place'));
print_r($j3->data());
$j4 = $people->join($location, array('id' => 'person'));
$j5 = $places->join($j4, array('id' => 'place'));
print_r($j5->data());
$f = new filter();
$f->add(new constraint('name', 'Home'));
$f->add(new constraint('id', 3));
$places->addFilter($f);
$places->addFilter(new filter(new constraint('id', 3)));
//print_r($places->join($location->join($people, array('person' => 'id')), array('id' => 'place'))->data());
//print_r($places->join($location->join($people, array('person' => 'id')), array('id' => 'place'))->data());
//print_r($places->join($location->join($people, array('person' => 'id')), array('id' => 'place'))->data(true));
print_r($places->data());
//$location->setFilter('person', 1);