/** * Return the request * * @param string $handle * * @param array $options * * @throws Exception * * @return mixed */ public function findRequestByHandle($handle) { Craft::log(__METHOD__, LogLevel::Info, true); // Get the request record by its handle // --------------------------------------------- $record = Placid_RequestsRecord::model()->find('handle=:handle', array(':handle' => $handle)); if ($record) { return Placid_RequestsModel::populateModel($record); } else { throw new Exception(Craft::t('Can\'t find request with handle "{handle}"', array('handle' => $handle))); } }
public function getRequestById($id) { if ($record = Placid_RequestsRecord::model()->findByPk($id)) { return Placid_RequestsModel::populateModel($record); } return null; }