本文整理汇总了PHP中thebuggenie\core\entities\Project::getAllByIDs方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getAllByIDs方法的具体用法?PHP Project::getAllByIDs怎么用?PHP Project::getAllByIDs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\entities\Project
的用法示例。
在下文中一共展示了Project::getAllByIDs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runFilterGetDynamicChoices
public function runFilterGetDynamicChoices(framework\Request $request)
{
$subproject_ids = explode(',', $request['subprojects']);
$existing_ids = $request['existing_ids'];
$results = array();
$projects = $request['project_id'] != '' ? entities\Project::getAllByIDs(explode(',', $request['project_id'])) : entities\Project::getAll();
$items = array('build' => array(), 'edition' => array(), 'component' => array(), 'milestone' => array());
foreach ($projects as $project) {
foreach ($project->getBuilds() as $build) {
$items['build'][$build->getID()] = $build;
}
foreach ($project->getEditions() as $edition) {
$items['edition'][$edition->getID()] = $edition;
}
foreach ($project->getComponents() as $component) {
$items['component'][$component->getID()] = $component;
}
foreach ($project->getMilestones() as $milestone) {
$items['milestone'][$milestone->getID()] = $milestone;
}
}
$filters = array();
$filters['build'] = entities\SearchFilter::createFilter('build');
$filters['edition'] = entities\SearchFilter::createFilter('edition');
$filters['component'] = entities\SearchFilter::createFilter('component');
$filters['milestone'] = entities\SearchFilter::createFilter('milestone');
if (isset($existing_ids['build'])) {
foreach (tables\Builds::getTable()->getByIDs($existing_ids['build']) as $build) {
$items['build'][$build->getID()] = $build;
}
$filters['build']->setValue(join(',', $existing_ids['build']));
}
if (isset($existing_ids['edition'])) {
foreach (tables\Editions::getTable()->getByIDs($existing_ids['edition']) as $edition) {
$items['edition'][$edition->getID()] = $edition;
}
$filters['edition']->setValue(join(',', $existing_ids['edition']));
}
if (isset($existing_ids['component'])) {
foreach (tables\Components::getTable()->getByIDs($existing_ids['component']) as $component) {
$items['component'][$component->getID()] = $component;
}
$filters['component']->setValue(join(',', $existing_ids['component']));
}
if (isset($existing_ids['milestone'])) {
foreach (tables\Milestones::getTable()->getByIDs($existing_ids['milestone']) as $milestone) {
$items['milestone'][$milestone->getID()] = $milestone;
}
$filters['milestone']->setValue(join(',', $existing_ids['milestone']));
}
foreach (array('build', 'edition', 'component', 'milestone') as $k) {
$results[$k] = $this->getComponentHTML('search/interactivefilterdynamicchoicelist', array('filter' => $filters[$k], 'items' => $items[$k]));
}
return $this->renderJSON(compact('results'));
}