本文整理汇总了PHP中EmailTemplate::getSubset方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailTemplate::getSubset方法的具体用法?PHP EmailTemplate::getSubset怎么用?PHP EmailTemplate::getSubset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailTemplate
的用法示例。
在下文中一共展示了EmailTemplate::getSubset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: run
public function run()
{
$timestamp = time() - static::DRAFT_LIFE_TIME_IN_DAYS * 24 * 60 * 60;
$dateTime = DateTimeUtil::convertTimestampToDbFormatDateTime($timestamp);
$searchAttributeData = array();
$searchAttributeData['clauses'] = array(1 => array('attributeName' => 'createdDateTime', 'operatorType' => 'lessThan', 'value' => $dateTime), 2 => array('attributeName' => 'isDraft', 'operatorType' => 'equals', 'value' => 1));
$searchAttributeData['structure'] = '1 and 2';
$joinTablesAdapter = new RedBeanModelJoinTablesQueryAdapter('EmailTemplate');
$where = RedBeanModelDataProvider::makeWhere('EmailTemplate', $searchAttributeData, $joinTablesAdapter);
$models = EmailTemplate::getSubset($joinTablesAdapter, null, null, $where, null);
foreach ($models as $model) {
$model->delete();
}
return true;
}