File modules/cms/generator/dsl/DslProject.class.php

Last commit: Mon Jun 27 00:40:42 2022 +0200	Jan Dankert	New: Marker interface 'Scriptable', Proxy class for MQTT, help() method in Scripts.
1 <?php 2 3 namespace cms\generator\dsl; 4 5 use cms\model\Folder; 6 use cms\model\Project; 7 use dsl\context\BaseScriptableObject; 8 9 class DslProject extends BaseScriptableObject 10 { 11 private $project; 12 13 public $id; 14 public $url; 15 public $name; 16 17 /** 18 * DslPage constructor. 19 * @param Project $project 20 */ 21 public function __construct($project) 22 { 23 $this->project = $project; 24 25 $this->id = $project->getId(); 26 $this->name = $project->name; 27 $this->url = $project->url; 28 } 29 30 /** 31 * @return array 32 * @throws \util\exception\ObjectNotFoundException 33 */ 34 public function languages() { 35 36 return array_map( function( $language ) { 37 return get_object_vars($language); 38 } ,$this->project->getLanguages() ); 39 } 40 41 /** 42 * @return array 43 * @throws \util\exception\ObjectNotFoundException 44 */ 45 public function models() { 46 47 return array_map( function($model ) { 48 return get_object_vars($model); 49 } ,$this->project->getModels() ); 50 } 51 52 /** 53 * @return DslObject 54 * @throws \util\exception\ObjectNotFoundException 55 */ 56 public function root() { 57 58 $oid = $this->project->getRootObjectId(); 59 $folder = new Folder( $oid ); 60 return new DslObject( $folder->load() ); 61 } 62 63 }
Download modules/cms/generator/dsl/DslProject.class.php
History Mon, 27 Jun 2022 00:40:42 +0200 Jan Dankert New: Marker interface 'Scriptable', Proxy class for MQTT, help() method in Scripts. Sat, 25 Jun 2022 14:26:33 +0200 Jan Dankert New: Many Enhancements for the internal script language: More access to the data structure of pages, folders, templates, ... Sun, 5 Jun 2022 22:14:24 +0200 Jan Dankert Some fixups: New Icons; better support classes for DSL. Tue, 31 May 2022 00:32:27 +0200 Jan Dankert New: More context objects for the DSL