当前位置: 首页>>代码示例>>PHP>>正文


PHP Admin::setModelId方法代码示例

本文整理汇总了PHP中Admin::setModelId方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::setModelId方法的具体用法?PHP Admin::setModelId怎么用?PHP Admin::setModelId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Admin的用法示例。


在下文中一共展示了Admin::setModelId方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionEdit

 /**
  * Edits or adds medications
  *
  * @param bool|int $id
  * @throws CHttpException
  */
 public function actionEdit($id = false)
 {
     $admin = new Admin(MedicationDrug::model(), $this);
     if ($id) {
         $admin->setModelId($id);
     }
     $admin->setEditFields(array('name' => 'text', 'aliases' => 'text', 'external_source' => array('widget' => 'DropDownList', 'options' => CHtml::listData(MedicationDrug::model()->findAll(new CDbCriteria(array('group' => 'external_source'))), 'external_source', 'external_source'), 'htmlOptions' => null, 'hidden' => false, 'layoutColumns' => null), 'external_code' => 'text'));
     $admin->editModel();
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:15,代码来源:MedicationController.php

示例2: actionEdit

 /**
  * Edits or adds a Procedure
  *
  * @param bool|int $id
  * @throws CHttpException
  */
 public function actionEdit($id = false)
 {
     $admin = new Admin(Complication::model(), $this);
     if ($id) {
         $admin->setModelId($id);
     }
     $admin->setEditFields(array('name' => 'text', 'active' => 'checkbox'));
     $admin->editModel();
 }
开发者ID:code-4-england,项目名称:OpenEyes,代码行数:15,代码来源:ComplicationController.php

示例3: actionEdit

 /**
  * Edits or adds a lens type.
  *
  * @param bool|int $id
  *
  * @throws CHttpException
  */
 public function actionEdit($id = false)
 {
     $admin = new Admin(OphInBiometry_LensType_Lens::model(), $this);
     if ($id) {
         $admin->setModelId($id);
     }
     $admin->setModelDisplayName('Lens types');
     $admin->setEditFields(array('name' => 'text', 'description' => 'text', 'acon' => 'text', 'active' => 'checkbox'));
     $admin->editModel();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:17,代码来源:LensTypeAdminController.php

示例4: actionEdit

 /**
  * Edits or adds a Procedure.
  *
  * @param bool|int $id
  *
  * @throws CHttpException
  */
 public function actionEdit($id = false)
 {
     $admin = new Admin(UniqueCodes::model(), $this);
     if ($id) {
         $admin->setModelId($id);
     }
     $admin->setModelDisplayName('Unique Codes');
     $admin->setEditFields(array('code' => 'label', 'active' => 'checkbox'));
     $admin->editModel();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:17,代码来源:UniqueCodesController.php

示例5: actionEdit

 /**
  * Edits or adds an operative device.
  *
  * @param bool|int $id
  *
  * @throws CHttpException
  */
 public function actionEdit($id = false)
 {
     $admin = new Admin(OperativeDevice::model(), $this);
     $admin->setModelDisplayName('Operative Device');
     if ($id) {
         $admin->setModelId($id);
     }
     $admin->setEditFields(array('name' => 'text', 'active' => 'checkbox'));
     $admin->editModel();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:17,代码来源:OperativeDeviceController.php

示例6: actionEdit

 /**
  * Edits or adds a Procedure.
  *
  * @param bool|int $id
  *
  * @throws CHttpException
  */
 public function actionEdit($id = false)
 {
     $admin = new Admin(FormularyDrugs::model(), $this);
     if ($id) {
         $admin->setModelId($id);
     }
     $admin->setModelDisplayName('Formulary Drugs');
     $criteria = new CDbCriteria();
     $admin->setEditFields(array('id' => 'label', 'name' => 'text', 'type_id' => array('widget' => 'DropDownList', 'options' => CHtml::listData(DrugType::model()->findAll(), 'id', 'name'), 'htmlOptions' => null, 'hidden' => false, 'layoutColumns' => null), 'aliases' => 'text', 'tallman' => 'text', 'form_id' => array('widget' => 'DropDownList', 'options' => CHtml::listData(DrugForm::model()->findAll(), 'id', 'name'), 'htmlOptions' => null, 'hidden' => false, 'layoutColumns' => null), 'dose_unit' => 'text', 'default_dose' => 'text', 'default_route_id' => array('widget' => 'DropDownList', 'options' => CHtml::listData(DrugRoute::model()->findAll(), 'id', 'name'), 'htmlOptions' => array('empty' => '-- Please select --'), 'hidden' => false, 'layoutColumns' => null), 'default_frequency_id' => array('widget' => 'DropDownList', 'options' => CHtml::listData(DrugFrequency::model()->findAll(), 'id', 'name'), 'htmlOptions' => array('empty' => '-- Please select --'), 'hidden' => false, 'layoutColumns' => null), 'default_duration_id' => array('widget' => 'DropDownList', 'options' => CHtml::listData(DrugDuration::model()->findAll(), 'id', 'name'), 'htmlOptions' => array('empty' => '-- Please select --'), 'hidden' => false, 'layoutColumns' => null), 'preservative_free' => 'checkbox', 'active' => 'checkbox', 'allergy_warnings' => array('widget' => 'MultiSelectList', 'relation_field_id' => 'id', 'label' => 'Allergy Warnings', 'options' => CHtml::encodeArray(CHtml::listData(Allergy::model()->findAll($criteria->condition = "name != 'Other'"), 'id', 'name')))));
     $admin->editModel();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:18,代码来源:FormularyDrugsController.php

示例7: actionEdit

 /**
  * Edits or adds a Procedure.
  *
  * @param bool|int $id
  *
  * @throws CHttpException
  */
 public function actionEdit($id = false)
 {
     $admin = new Admin(OEModule\OphCiExamination\models\OphCiExamination_Attribute::model(), $this);
     $admin->setCustomSaveURL('/oeadmin/ExaminationElementAttributes/update');
     if ($id) {
         $admin->setModelId($id);
     }
     $admin->setModelDisplayName('Element Attributes');
     $admin->setEditFields(array('id' => 'label', 'name' => 'text', 'label' => 'text', 'attribute_elements' => array('widget' => 'DropDownList', 'options' => CHtml::listData(ElementType::model()->findAll(), 'id', 'name'), 'htmlOptions' => null, 'hidden' => false, 'layoutColumns' => null)));
     $admin->editModel();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:18,代码来源:ExaminationElementAttributesController.php

示例8: initAdmin

 /**
  * Init the edit admin page, because we have a custom save URL, so we need to use
  * Admin in more then 1 function.
  *
  * @param bool $id
  *
  * @return Admin
  */
 protected function initAdmin($id = false)
 {
     $admin = new Admin(DrugSet::model(), $this);
     if ($id) {
         $admin->setModelId($id);
     }
     $element = Element_OphDrPrescription_Details::model();
     $admin->setCustomSaveURL('/OphDrPrescription/DrugSetAdmin/SaveDrugSet');
     $admin->setCustomCancelURL('/OphDrPrescription/DrugSetAdmin/DrugSets');
     $admin->setEditFields(array('active' => 'checkbox', 'name' => 'text', 'subspecialty' => array('widget' => 'DropDownList', 'options' => CHtml::listData(Subspecialty::model()->findAll(), 'id', 'name'), 'htmlOptions' => null, 'hidden' => false, 'layoutColumns' => null), 'setItems' => array('widget' => 'CustomView', 'viewName' => '/default/form_Element_OphDrPrescription_Details', 'viewArguments' => array('element' => $element))));
     return $admin;
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:20,代码来源:DrugSetAdminController.php

示例9: actionEdit

 /**
  * Edits or adds a Procedure.
  *
  * @param bool|int $id
  *
  * @throws CHttpException
  */
 public function actionEdit($id = false)
 {
     $admin = new Admin(Procedure::model(), $this);
     if ($id) {
         $admin->setModelId($id);
     }
     $admin->setEditFields(array('term' => 'text', 'short_format' => 'text', 'default_duration' => 'text', 'snomed_code' => 'text', 'snomed_term' => 'text', 'aliases' => 'text', 'unbooked' => 'checkbox', 'active' => 'checkbox', 'opcsCodes' => array('widget' => 'MultiSelectList', 'relation_field_id' => 'id', 'label' => 'OPCS Code', 'options' => CHtml::encodeArray(CHtml::listData(OPCSCode::model()->findAll(), 'id', function ($model) {
         return $model->name . ': ' . $model->description;
     }))), 'benefits' => array('widget' => 'MultiSelectList', 'relation_field_id' => 'id', 'label' => 'Benefit', 'options' => CHtml::encodeArray(CHtml::listData(Benefit::model()->findAll(), 'id', 'name'))), 'complications' => array('widget' => 'MultiSelectList', 'relation_field_id' => 'id', 'label' => 'Complication', 'options' => CHtml::encodeArray(CHtml::listData(Complication::model()->findAll(), 'id', 'name')))));
     if (isset($admin->getModel()->operationNotes)) {
         $admin->setEditFields(array_merge($admin->getEditFields(), array('operationNotes' => array('widget' => 'MultiSelectList', 'relation_field_id' => 'id', 'label' => 'Operation Note Element', 'options' => CHtml::encodeArray(CHtml::listData(ElementType::model()->findAllByAttributes(array(), 'event_type_id in (select id from event_type where name = "Operation Note")'), 'id', 'name'))))));
     }
     $admin->editModel();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:21,代码来源:ProcedureController.php


注:本文中的Admin::setModelId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。