本文整理汇总了PHP中ElggObject::setMetaData方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggObject::setMetaData方法的具体用法?PHP ElggObject::setMetaData怎么用?PHP ElggObject::setMetaData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggObject
的用法示例。
在下文中一共展示了ElggObject::setMetaData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testFilterHeavyEntities
public function testFilterHeavyEntities()
{
$big_str = str_repeat('-', 5000);
$this->obj2->setMetaData($this->name, array($big_str, $big_str));
$guids = array($this->guid1, $this->guid2);
$expected = array($this->guid1);
$actual = $this->cache->filterMetadataHeavyEntities($guids, 6000);
$this->assertIdentical($actual, $expected);
}
示例2: setMetaData
public function setMetaData($name, $value, $value_type = "", $multiple = false)
{
if (parent::setMetaData($name, $value, $value_type, $multiple)) {
if (is_array($this->meta_cache) && array_key_exists($name, $this->meta_cache)) {
$this->meta_cache[$name] = $value;
}
return true;
}
}
示例3: ElggObject
<?php
/**
* ElggChat - Pure Elgg-based chat/IM
*
* Action to create a chat session with specified user
*
* @package elggchat
* @author ColdTrick IT Solutions
* @copyright Coldtrick IT Solutions 2009
* @link http://www.coldtrick.com/
*
* for Elgg 1.8 and newer by iionly (iionly@gmx.de)
* @copyright iionly 2014
* @link https://github.com/iionly
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
*/
$inviteId = (int) get_input("invite");
$user = elgg_get_logged_in_user_entity();
if (($invite_user = get_user($inviteId)) && $inviteId != $user->guid) {
$session = new ElggObject();
$session->subtype = ELGGCHAT_SESSION_SUBTYPE;
$session->access_id = ACCESS_LOGGED_IN;
$session->setMetaData("tag", "");
$session->save();
$session->addRelationship($user->guid, ELGGCHAT_MEMBER);
$session->addRelationship($invite_user->guid, ELGGCHAT_MEMBER);
echo $session->guid;
}
exit;