本文整理汇总了PHP中RedBeanModelDataProvider类的典型用法代码示例。如果您正苦于以下问题:PHP RedBeanModelDataProvider类的具体用法?PHP RedBeanModelDataProvider怎么用?PHP RedBeanModelDataProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RedBeanModelDataProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getReportsByPartialName
/**
* @param $partialName
* @param $pageSize
* @param null|string $moduleClassName
* @param null|string $type
* @return Array of SavedReport models
*/
public static function getReportsByPartialName($partialName, $pageSize, $moduleClassName = null, $type = null)
{
assert('is_string($partialName)');
assert('is_int($pageSize)');
assert('is_string($moduleClassName) || $moduleClassName == null');
assert('is_string($type) || $type == null');
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'name', 'operatorType' => 'contains', 'value' => $partialName));
$clauseCount = 2;
if ($moduleClassName != null) {
$searchAttributeData['clauses'][$clauseCount] = array('attributeName' => 'moduleClassName', 'operatorType' => 'equals', 'value' => $moduleClassName);
$clauseCount++;
}
if ($type != null) {
$searchAttributeData['clauses'][$clauseCount] = array('attributeName' => 'type', 'operatorType' => 'equals', 'value' => $type);
}
if ($clauseCount == 1) {
$searchAttributeData['structure'] = '(1)';
} elseif ($clauseCount == 2) {
$searchAttributeData['structure'] = '(1 and 2)';
} else {
$searchAttributeData['structure'] = '(1 and 2 and 3)';
}
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('SavedReport');
$where = RedBeanModelDataProvider::makeWhere('SavedReport', $searchAttributeData, $joinTablesAdapter);
return SavedReport::getSubset($joinTablesAdapter, null, $pageSize, $where, 'name');
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:34,代码来源:ReportSearch.php
示例2: preFilter
protected function preFilter($filterChain)
{
if (isset($_POST['ajax'])) {
return true;
}
$modelClassName = $this->modelClassName;
if ($modelClassName == null) {
$modelClassName = $this->controller->getModule()->getPrimaryModelName();
}
if ($this->stateMetadataAdapterClassName != null) {
$stateClassName = $this->stateMetadataAdapterClassName;
$metadata = array('clauses' => array(), 'structure' => '');
$stateMetadataAdapter = new $stateClassName($metadata);
$metadata = $stateMetadataAdapter->getAdaptedDataProviderMetadata();
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter($modelClassName);
$where = RedBeanModelDataProvider::makeWhere($modelClassName, $metadata, $joinTablesAdapter);
} else {
$joinTablesAdapter = null;
$where = null;
}
if ($modelClassName::getCount($joinTablesAdapter, $where) != 0) {
return true;
}
$messageViewClassName = $this->getMessageViewClassName();
if ($messageViewClassName == null) {
$messageViewClassName = $this->controller->getModule()->getPluralCamelCasedName() . 'ZeroModelsYetView';
}
$messageView = new $messageViewClassName($this->resolveMessageControllerId(), $this->resolveMessageModuleId(), $modelClassName);
$this->resolveAndRenderView($messageView);
return false;
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:31,代码来源:ZeroModelsCheckControllerFilter.php
示例3: getUnreadCountForCurrentUser
public function getUnreadCountForCurrentUser()
{
$searchAttributeData = $this->getMetadataForUnreadForCurrentUser();
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('Mission');
$where = RedBeanModelDataProvider::makeWhere('Mission', $searchAttributeData, $joinTablesAdapter);
return Mission::getCount($joinTablesAdapter, $where, 'Mission', true);
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:7,代码来源:MissionMashableInboxRules.php
示例4: getEmailTemplatesByPartialName
/**
* @param $partialName
* @param $pageSize
* @param null|string $moduleClassName
* @param null|string $type
* @return Array of SavedReport models
*/
public static function getEmailTemplatesByPartialName($partialName, $pageSize, $modelClassName = null, $type = null)
{
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'type', 'operatorType' => 'equals', 'value' => intval($type)), 2 => array('attributeName' => 'modelClassName', 'operatorType' => 'equals', 'value' => $modelClassName), 3 => array('attributeName' => 'isDraft', 'operatorType' => 'equals', 'value' => intval(false)), 4 => array('attributeName' => 'name', 'operatorType' => 'contains', 'value' => $partialName));
$searchAttributeData['structure'] = '1 and 2 and 3 and 4';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('EmailTemplate');
$where = RedBeanModelDataProvider::makeWhere('EmailTemplate', $searchAttributeData, $joinTablesAdapter);
return EmailTemplate::getSubset($joinTablesAdapter, null, $pageSize, $where, 'name');
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:16,代码来源:EmailTemplateSearch.php
示例5: getIdsByUsersMemberOfGroup
public static function getIdsByUsersMemberOfGroup($groupId)
{
$groupId = intval($groupId);
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'users', 'relatedModelData' => array('attributeName' => 'groups', 'relatedAttributeName' => 'id', 'operatorType' => 'equals', 'value' => $groupId)));
$searchAttributeData['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter(get_called_class());
$where = RedBeanModelDataProvider::makeWhere(get_called_class(), $searchAttributeData, $joinTablesAdapter);
return static::getSubsetIds($joinTablesAdapter, null, null, $where);
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:9,代码来源:Role.php
示例6: getByTask
/**
* Given a related model id return a list of check items models.
* @param integer $taskId
*/
public static function getByTask($taskId)
{
assert('is_int($taskId)');
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('TaskCheckListItem');
$orderBySortColumnName = RedBeanModelDataProvider::resolveSortAttributeColumnName('TaskCheckListItem', $joinTablesAdapter, 'sortOrder');
$orderByColumnNameFallback = RedBeanModelDataProvider::resolveSortAttributeColumnName('TaskCheckListItem', $joinTablesAdapter, 'id');
$where = "task_id = '" . $taskId . "'";
$orderBy = $orderBySortColumnName . 'asc, ' . $orderByColumnNameFallback . ' desc';
return self::getSubset($joinTablesAdapter, null, null, $where, $orderBy);
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:14,代码来源:TaskCheckListItem.php
示例7: getAccountsByPartialName
/**
* For a given partialName, run search by partial name and retrieve account models.
* @param string $partialName
* @param null|int $pageSize
*/
public static function getAccountsByPartialName($partialName, $pageSize = null)
{
assert('is_string($partialName)');
$metadata = array();
$metadata['clauses'] = array(1 => array('attributeName' => 'name', 'operatorType' => 'contains', 'value' => $partialName));
$metadata['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('Account');
$where = RedBeanModelDataProvider::makeWhere('Account', $metadata, $joinTablesAdapter);
return Account::getSubset($joinTablesAdapter, null, $pageSize, $where);
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:15,代码来源:AccountSearch.php
示例8: getAccountsByAnyEmailAddress
/**
* For a given email address, run search by email address and retrieve account models.
*/
public static function getAccountsByAnyEmailAddress($emailAddress, $pageSize = null)
{
assert('is_string($emailAddress)');
$metadata = array();
$metadata['clauses'] = array(1 => array('attributeName' => 'primaryEmail', 'relatedAttributeName' => 'emailAddress', 'operatorType' => 'equals', 'value' => $emailAddress), 2 => array('attributeName' => 'secondaryEmail', 'relatedAttributeName' => 'emailAddress', 'operatorType' => 'equals', 'value' => $emailAddress));
$metadata['structure'] = '(1 or 2)';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('Account');
$where = RedBeanModelDataProvider::makeWhere('Account', $metadata, $joinTablesAdapter);
return Account::getSubset($joinTablesAdapter, null, $pageSize, $where);
}
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:13,代码来源:AccountSearch.php
示例9: getByType
/**
* @param string $type
* @param null|int $pageSize
*/
public static function getByType($type, $pageSize = null)
{
assert('is_string($type)');
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'type', 'operatorType' => 'equals', 'value' => $type));
$searchAttributeData['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter(get_called_class());
$where = RedBeanModelDataProvider::makeWhere(get_called_class(), $searchAttributeData, $joinTablesAdapter);
return self::getSubset($joinTablesAdapter, null, $pageSize, $where, null);
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:14,代码来源:JobLog.php
示例10: getAllByFolderType
public static function getAllByFolderType($type)
{
assert('is_string($type)');
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'folder', 'relatedAttributeName' => 'type', 'operatorType' => 'equals', 'value' => $type));
$searchAttributeData['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('EmailMessage');
$where = RedBeanModelDataProvider::makeWhere('EmailMessage', $searchAttributeData, $joinTablesAdapter);
return self::getSubset($joinTablesAdapter, null, null, $where, null);
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:EmailMessage.php
示例11: getCountByUser
public static function getCountByUser(User $user)
{
assert('$user->id > 0');
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'owner', 'relatedAttributeName' => 'id', 'operatorType' => 'equals', 'value' => $user->id));
$searchAttributeData['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('Notification');
$where = RedBeanModelDataProvider::makeWhere('Notification', $searchAttributeData, $joinTablesAdapter);
return self::getCount($joinTablesAdapter, $where, null, true);
}
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:10,代码来源:Notification.php
示例12: getAllByUser
/**
* Given a user, retrieval all notifications for that user, sorted desc by Id
* @param User $user
*/
public static function getAllByUser(User $user)
{
assert('$user->id > 0');
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'user', 'relatedAttributeName' => 'id', 'operatorType' => 'equals', 'value' => $user->id));
$searchAttributeData['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('GameNotification');
$where = RedBeanModelDataProvider::makeWhere('GameNotification', $searchAttributeData, $joinTablesAdapter);
$models = self::getSubset($joinTablesAdapter, null, null, $where, 'gamenotification.id asc');
return $models;
}
开发者ID:youprofit,项目名称:Zurmo,代码行数:15,代码来源:GameNotification.php
示例13: getByOwnerAndViewClassName
/**
* @param User $user
* @param string $viewClassName
*/
public static function getByOwnerAndViewClassName(User $user, $viewClassName)
{
assert('$user->id > 0');
assert('is_string($viewClassName)');
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'owner', 'operatorType' => 'equals', 'value' => $user->id), 2 => array('attributeName' => 'viewClassName', 'operatorType' => 'equals', 'value' => $viewClassName));
$searchAttributeData['structure'] = '1 and 2';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('SavedSearch');
$where = RedBeanModelDataProvider::makeWhere('SavedSearch', $searchAttributeData, $joinTablesAdapter);
return self::getSubset($joinTablesAdapter, null, null, $where, null);
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:15,代码来源:SavedSearch.php
示例14: getCommentsByRelatedModelTypeIdAndPageSize
/**
* Given a related model type, a related model id, and a page size, return a list of comment models.
* @param string $type
* @param integer $relatedId
* @param integer $pageSize
*/
public static function getCommentsByRelatedModelTypeIdAndPageSize($type, $relatedId, $pageSize)
{
assert('is_string($type)');
assert('is_int($relatedId)');
assert('is_int($pageSize) || $pageSize = null');
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('Comment');
$orderByColumnName = RedBeanModelDataProvider::resolveSortAttributeColumnName('Comment', $joinTablesAdapter, 'createdDateTime');
$where = "relatedmodel_type = '" . strtolower($type) . "' AND relatedmodel_id = '" . $relatedId . "'";
$orderBy = $orderByColumnName . ' desc';
return self::getSubset($joinTablesAdapter, null, $pageSize, $where, $orderBy);
}
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:17,代码来源:Comment.php
示例15: getModelsToProcess
/**
* @param $pageSize
* @return array of WorkflowMessageInQueue models
*/
public static function getModelsToProcess($pageSize)
{
assert('is_int($pageSize)');
$timeStamp = DateTimeUtil::convertTimestampToDbFormatDateTime(time());
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'processDateTime', 'operatorType' => 'lessThan', 'value' => $timeStamp));
$searchAttributeData['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('WorkflowMessageInQueue');
$where = RedBeanModelDataProvider::makeWhere('WorkflowMessageInQueue', $searchAttributeData, $joinTablesAdapter);
return self::getSubset($joinTablesAdapter, null, $pageSize, $where, null);
}
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:15,代码来源:WorkflowMessageInQueue.php
示例16: getModelsTResolveToJobQueue
public static function getModelsTResolveToJobQueue($pageSize, $offset, $modelClassName, $timeStamp)
{
assert('is_int($pageSize) || $pageSize == null');
assert('is_int($offset)');
assert('is_string($modelClassName)');
assert('is_int($timeStamp)');
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'processDateTime', 'operatorType' => 'greaterThan', 'value' => DateTimeUtil::convertTimestampToDbFormatDateTime($timeStamp)));
$searchAttributeData['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter($modelClassName);
$where = RedBeanModelDataProvider::makeWhere($modelClassName, $searchAttributeData, $joinTablesAdapter);
return $modelClassName::getSubset($joinTablesAdapter, $offset, $pageSize, $where, null);
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:13,代码来源:InQueueJob.php
示例17: deleteRelatedFileContentIfNotRelatedToAnyOtherFileModel
protected function deleteRelatedFileContentIfNotRelatedToAnyOtherFileModel()
{
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'fileContent', 'relatedModelData' => array('attributeName' => 'id', 'operatorType' => 'equals', 'value' => $this->fileContent->id)));
$searchAttributeData['structure'] = '1';
$class = get_class($this);
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter($class);
$where = RedBeanModelDataProvider::makeWhere($class, $searchAttributeData, $joinTablesAdapter);
if (static::getCount($joinTablesAdapter, $where, $class) == 1) {
return $this->fileContent->delete();
}
return true;
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:13,代码来源:FileModel.php
示例18: run
/**
* Get all imports where the modifiedDateTime was more than 1 week ago. Then
* delete the imports.
* (non-PHPdoc)
* @see BaseJob::run()
*/
public function run()
{
$oneWeekAgoTimeStamp = DateTimeUtil::convertTimestampToDbFormatDateTime(time() - 60 * 60 * 24 * 7);
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'modifiedDateTime', 'operatorType' => 'lessThan', 'value' => $oneWeekAgoTimeStamp));
$searchAttributeData['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('Import');
$where = RedBeanModelDataProvider::makeWhere('Import', $searchAttributeData, $joinTablesAdapter);
$importModels = Import::getSubset($joinTablesAdapter, null, self::$pageSize, $where, null);
foreach ($importModels as $import) {
$import->delete();
}
return true;
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:20,代码来源:ImportCleanupJob.php
示例19: getByActivityItemsCastedDown
/**
* Get by activity items casted down
* @param int $relationItemId
* @return integer
*/
public static function getByActivityItemsCastedDown($relationItemId)
{
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'activityItems', 'relatedAttributeName' => 'id', 'operatorType' => 'equals', 'value' => intval($relationItemId)));
$searchAttributeData['structure'] = '1';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter(get_called_class());
$where = RedBeanModelDataProvider::makeWhere(get_called_class(), $searchAttributeData, $joinTablesAdapter);
$models = self::getSubset($joinTablesAdapter, null, null, $where, null);
if (count($models) == 0) {
return null;
} else {
return $models;
}
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:19,代码来源:Activity.php
示例20: getUsersByEmailAddress
public static function getUsersByEmailAddress($emailAddress, $operatorType = null)
{
assert('is_string($emailAddress)');
assert('$operatorType == null || is_string($operatorType)');
if ($operatorType == null) {
$operatorType = 'equals';
}
$metadata = array();
$metadata['clauses'] = array(1 => array('attributeName' => 'primaryEmail', 'relatedAttributeName' => 'emailAddress', 'operatorType' => $operatorType, 'value' => $emailAddress));
$metadata['structure'] = '(1)';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('User');
$where = RedBeanModelDataProvider::makeWhere('User', $metadata, $joinTablesAdapter);
$users = User::getSubset($joinTablesAdapter, null, null, $where);
return $users;
}
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:15,代码来源:UserSearch.php
注:本文中的RedBeanModelDataProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论