/** * Returns drafts of a given entry. * * @param int $entryId * @param string $localeId * @return array */ public function getDraftsByEntryId($entryId, $localeId = null) { if (!$localeId) { $localeId = craft()->i18n->getPrimarySiteLocale(); } $draftRecords = EntryDraftRecord::model()->findAllByAttributes(array('entryId' => $entryId, 'locale' => $localeId)); return EntryDraftModel::populateModels($draftRecords); }
public function actionDrafts() { $records = EntryDraftRecord::model()->findAll(); $drafts = EntryDraftModel::populateModels($records); $this->renderTemplate('workflow/drafts', array('entries' => $drafts)); }