本文整理汇总了PHP中BaseController::prepareForEdit方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseController::prepareForEdit方法的具体用法?PHP BaseController::prepareForEdit怎么用?PHP BaseController::prepareForEdit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseController
的用法示例。
在下文中一共展示了BaseController::prepareForEdit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareForEdit
/**
* Override the edit action to supply some selectable relationships
*
* @param MappedObject $model
*/
protected function prepareForEdit($model = null)
{
$clientid = $model && $model->clientid ? $model->clientid : (int) $this->_getParam('clientid');
// check the existence of the client to add this contact to
$client = $clientid ? $this->clientService->getClient($clientid) : null;
// check the existence of the client to add this contact to
$this->view->owners = $this->groupService->getGroups();
$this->view->users = $this->userService->getUserList();
$this->view->client = $client;
$this->view->clients = $this->clientService->getClients();
$this->view->projects = $clientid ? $this->projectService->getProjectsForClient($client) : array();
parent::prepareForEdit($model);
}
示例2: prepareForEdit
/**
* Prepare a feature to be edited
*
* @param Feature $model
* @return
*/
public function prepareForEdit($model)
{
$project = $this->projectService->getProject((int) $this->_getParam('projectid', $model->projectid));
$parentFeature = $this->projectService->getFeature((int) $this->_getParam('parent'));
if ($project == null) {
$this->flash("Specified project not found");
$this->renderView('error.php');
return;
}
$this->view->project = $project;
if ($parentFeature) {
$this->view->parentfeature = $parentFeature->id;
}
if ($model->id) {
$this->view->linkedToFeatures = $this->itemLinkService->getLinkedItems($model, 'from', 'Feature');
$this->view->linkedFromFeatures = $this->itemLinkService->getLinkedItems($model, 'to', 'Feature');
} else {
$model->milestone = $this->_getParam('milestone');
}
$this->view->projects = $this->projectService->getProjectsForClient($project->clientid);
$this->view->projectFeatures = $this->featureService->getFeatures(array('projectid=' => $project->id));
$this->view->projectTasks = $this->projectService->getTasks(array('projectid=' => $project->id), 'title asc');
$this->view->priorities = array('Must Have', 'Should Have', 'Would Like', 'Nice To Have');
$this->view->statuses = $model->constraints['status']->getValues();
$this->view->linkedTasks = array();
if ($model->id) {
$this->view->linkedTasks = $this->itemLinkService->getLinkedItemsOfType($model, 'from', 'Task');
}
parent::prepareForEdit($model);
}