本文整理汇总了PHP中Conversation::getMetadata方法的典型用法代码示例。如果您正苦于以下问题:PHP Conversation::getMetadata方法的具体用法?PHP Conversation::getMetadata怎么用?PHP Conversation::getMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conversation
的用法示例。
在下文中一共展示了Conversation::getMetadata方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
$metadata = Conversation::getMetadata();
$observedModelClassNames = $metadata['Conversation']['conversationItemsModelClassNames'];
if ($observedModelClassNames == null) {
return;
}
foreach ($observedModelClassNames as $modelClassName) {
$modelClassName::model()->attachEventHandler('onAfterDelete', array($this, 'deleteConversationItems'));
}
}
示例2: canUserPerformAction
/**
* Runs through relations and makes sure the user can access at least one relation. If at least one is
* accessible, true is returned.
*/
public function canUserPerformAction()
{
$metadata = Conversation::getMetadata();
foreach ($metadata['Conversation']['conversationItemsModelClassNames'] as $modelClassName) {
if (is_subclass_of($modelClassName, 'Item') && $modelClassName::getModuleClassName() != null) {
if (RightsUtil::canUserAccessModule($modelClassName::getModuleClassName(), $this->user)) {
}
return true;
}
}
return false;
}
示例3: resolveNewModelByRelationInformation
/**
* Override to handle the special scenario of relations for a conversation. Since relations are done in the
* ConversationItems, the relation information needs to handled in a specific way.
* @see ZurmoModuleController->resolveNewModelByRelationInformation
*/
protected function resolveNewModelByRelationInformation($model, $relationModelClassName, $relationModelId, $relationModuleId)
{
assert('$model instanceof Conversation');
assert('is_string($relationModelClassName) || null');
assert('is_int($relationModelId)');
assert('is_string($relationModuleId)');
$metadata = Conversation::getMetadata();
if (in_array($relationModelClassName, $metadata['Conversation']['conversationItemsModelClassNames'])) {
$model->conversationItems->add($relationModelClassName::getById((int) $relationModelId));
} else {
throw new NotSupportedException();
}
return $model;
}
示例4: getRelatedItemsModelClassNames
protected static function getRelatedItemsModelClassNames()
{
$metadata = Conversation::getMetadata();
return $metadata['Conversation']['conversationItemsModelClassNames'];
}
示例5: __construct
public function __construct($relationModel)
{
$metadata = Conversation::getMetadata();
assert('in_array(get_class($relationModel), $metadata["Conversation"]["conversationItemsModelClassNames"])');
parent::__construct($relationModel);
}