Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getEntryDrafts($localeId = null)
- {
- if (!$localeId)
- {
- $localeId = craft()->i18n->getPrimarySiteLocale();
- }
- $drafts = array();
- $results = craft()->db->createCommand()
- ->select('*')
- ->from('entrydrafts')
- ->where(array('locale = :locale'), array(':locale' => $localeId))
- ->order('dateUpdated desc')
- ->queryAll();
- foreach ($results as $result)
- {
- $result['data'] = JsonHelper::decode($result['data']);
- // Don't initialize the content
- unset($result['data']['fields']);
- $drafts[] = EntryDraftModel::populateModel($result);
- }
- return $drafts;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement