コード例 #1
0
 public function updateCustomRecord($parameters)
 {
     ArticleFamily::where('id_351', $parameters['id'])->update(['name_351' => $this->request->input('name'), 'editor_id_351' => $this->request->has('editor') ? $this->request->input('editor') : null, 'field_group_id_351' => $this->request->has('customFieldGroup') ? $this->request->input('customFieldGroup') : null, 'data_351' => json_encode(['date' => $this->request->has('date'), 'title' => $this->request->has('title'), 'slug' => $this->request->has('slug'), 'link' => $this->request->has('link'), 'categories' => $this->request->has('categories'), 'sorting' => $this->request->has('sorting'), 'tags' => $this->request->has('tags')])]);
 }
コード例 #2
0
ファイル: ArticleFamily.php プロジェクト: syscover/cms
 public static function showRecord()
 {
     ArticleFamily::builder()->get()->first();
 }
コード例 #3
0
ファイル: ArticleController.php プロジェクト: syscover/cms
 public function editCustomRecord($parameters)
 {
     $parameters['sections'] = Section::all();
     $parameters['families'] = ArticleFamily::all();
     $parameters['tags'] = [];
     $tags = Tag::builder()->where('lang_id_358', $parameters['object']->lang_id_355)->get();
     foreach ($tags as $tag) {
         $parameters['tags'][] = ['value' => $tag->id_358, 'label' => $tag->name_358];
     }
     $objectTags = $parameters['object']->getTags;
     $parameters['selectTags'] = [];
     foreach ($objectTags as $objectTag) {
         $parameters['selectTags'][] = ['value' => $objectTag->id_358, 'label' => $objectTag->name_358];
     }
     $parameters['categories'] = Category::builder()->where('lang_id_352', $parameters['object']->lang_id)->get();
     $parameters['statuses'] = [(object) ['id' => 0, 'name' => trans('cms::pulsar.draft')], (object) ['id' => 1, 'name' => trans('cms::pulsar.publish')]];
     // get attachments elements
     $attachments = AttachmentLibrary::getRecords('cms', 'cms-article', $parameters['object']->id_355, $parameters['object']->lang_id);
     // merge parameters and attachments array
     $parameters['attachmentFamilies'] = AttachmentFamily::getAttachmentFamilies(['resource_id_015' => 'cms-article']);
     $parameters = array_merge($parameters, $attachments);
     return $parameters;
 }