/** * Retrieve OperativeDevice instances relevant to the current site and subspecialty. The default flag indicates * whether we are retrieve the full list of defaults. * * @param bool $default * * @return OperativeDevice[] */ protected function getOperativeDevicesBySiteAndSubspecialty($default = false, $include_ids = null) { $criteria = new CDbCriteria(); $criteria->addCondition('subspecialty_id = :subspecialtyId and site_id = :siteId'); $criteria->params[':subspecialtyId'] = $this->firm->getSubspecialtyID(); $criteria->params[':siteId'] = Yii::app()->session['selected_site_id']; if ($default) { $criteria->addCondition('siteSubspecialtyAssignments.default = :one'); $criteria->params[':one'] = 1; } $criteria->order = 'name asc'; return OperativeDevice::model()->activeOrPk($include_ids)->with(array('siteSubspecialtyAssignments' => array('joinType' => 'JOIN')))->findAll($criteria); }
public function getName() { return OperativeDevice::model()->findByPk($this->operative_device_id)->name; }
/** * Deletes rows for the model. */ public function actionDelete() { $admin = new Admin(OperativeDevice::model(), $this); $admin->deleteModel(); }