本文整理汇总了PHP中Idno\Common\Entity::setOwner方法的典型用法代码示例。如果您正苦于以下问题:PHP Entity::setOwner方法的具体用法?PHP Entity::setOwner怎么用?PHP Entity::setOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Idno\Common\Entity
的用法示例。
在下文中一共展示了Entity::setOwner方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Entity
/**
* A particularly knotty case when we get a webmention from *our
* own* feed. It looks valid because it includes a link, but it's
* not really.
*/
function testAddWebmentions_LocalFeed()
{
for ($i = 0; $i < 5; $i++) {
$entity = new Entity();
$entity->setOwner($this->user());
$entity->title = "This post will be the webmention target";
$entity->publish();
$entities[] = $entity;
$this->toDelete[] = $entity;
}
// take one from the middle
$entity = $entities[2];
$source = \Idno\Core\Idno::site()->config()->url;
$target = $entity->getURL();
// render the homepage feed
$sourceResp = Webservice::get($source);
$sourceContent = $sourceResp['content'];
$sourceMf2 = (new \Mf2\Parser($sourceContent, $source))->parse();
$entity->addWebmentions($source, $target, $sourceResp, $sourceMf2);
$this->assertEmpty($entity->getAllAnnotations());
}