本文整理汇总了PHP中SMWQuery::setSubject方法的典型用法代码示例。如果您正苦于以下问题:PHP SMWQuery::setSubject方法的具体用法?PHP SMWQuery::setSubject怎么用?PHP SMWQuery::setSubject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMWQuery
的用法示例。
在下文中一共展示了SMWQuery::setSubject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: queryProvider
public function queryProvider()
{
$subject = DIWikiPage::newFromText('Foo');
#0
$description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#1
$description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(new DIBlob('Bar')));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#2 uses inverse property declaration
$description = new SomeProperty(new DIProperty('Foobar', true), new ValueDescription(DIWikiPage::newFromText('Bar')));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#3 Conjunction
$description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
$query = new Query(new Conjunction(array($description, new NamespaceDescription(NS_MAIN))));
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#4 Disjunction
$description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
$query = new Query(new Disjunction(array($description, new NamespaceDescription(NS_MAIN))));
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#5
$description = new ClassDescription(DIWikiPage::newFromText('Foocat', NS_CATEGORY));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Foocat', NS_CATEGORY)));
#6
$description = new ConceptDescription(DIWikiPage::newFromText('FooConcept', SMW_NS_CONCEPT));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('FooConcept', SMW_NS_CONCEPT)));
#7 Printrequest
$pv = \SMWPropertyValue::makeUserProperty('Foobaz');
$description = new SomeProperty(new DIProperty('Foobar', true), new ValueDescription(DIWikiPage::newFromText('Bar')));
$description->addPrintRequest(new PrintRequest(PrintRequest::PRINT_PROP, '', $pv));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY), DIWikiPage::newFromText('Foobaz', SMW_NS_PROPERTY)));
#8 Inverse printrequest
$pv = \SMWPropertyValue::makeUserProperty('Foobaz');
$pv->setInverse(true);
$description = new SomeProperty(new DIProperty('Foobar', true), new ValueDescription(DIWikiPage::newFromText('Bar')));
$description->addPrintRequest(new PrintRequest(PrintRequest::PRINT_PROP, '', $pv));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY), DIWikiPage::newFromText('Foobaz', SMW_NS_PROPERTY)));
return $provider;
}
示例2: queryProvider
public function queryProvider()
{
$subject = DIWikiPage::newFromText('Foo');
#0
$description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#1
$description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(new DIBlob('Bar')));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#2 uses inverse property declaration
$description = new SomeProperty(new DIProperty('Foobar', true), new ValueDescription(DIWikiPage::newFromText('Bar')));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#3 Conjunction
$description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
$query = new Query(new Conjunction(array($description, new NamespaceDescription(NS_MAIN))));
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#4 Disjunction
$description = new SomeProperty(new DIProperty('Foobar'), new ValueDescription(DIWikiPage::newFromText('Bar')));
$query = new Query(new Disjunction(array($description, new NamespaceDescription(NS_MAIN))));
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Bar'), DIWikiPage::newFromText('Foobar', SMW_NS_PROPERTY)));
#5
$description = new ClassDescription(DIWikiPage::newFromText('Foocat', NS_CATEGORY));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('Foocat', NS_CATEGORY)));
#6
$description = new ConceptDescription(DIWikiPage::newFromText('FooConcept', SMW_NS_CONCEPT));
$query = new Query($description);
$query->setSubject($subject);
$provider[] = array($query, array(DIWikiPage::newFromText('Foo'), DIWikiPage::newFromText('FooConcept', SMW_NS_CONCEPT)));
return $provider;
}