コード例 #1
0
ファイル: Update.php プロジェクト: blerby/blerby
 public function getValue($name)
 {
     $ret = parent::getValue($name);
     // config gets special treatment
     if ($name == 'config') {
         if ($ret) {
             $obj = new Blerby_Entity_Object();
             $obj->fromArray(json_decode(stripcslashes($ret), true));
             $ret = $obj;
         }
     }
     return $ret;
 }
コード例 #2
0
ファイル: Component.php プロジェクト: blerby/blerby
 public function init($options = array())
 {
     if (!$this->meta instanceof Blerby_Entity_Object) {
         $meta = new Blerby_Entity_Object();
         $meta->fromArray($this->meta);
         $this->meta = $meta;
     }
     $dir = dirname($this->meta('file'));
     $metacache = $dir . "/metadata.xml";
     if (is_file($metacache)) {
         $xml = new SimpleXMLElement(file_get_contents($metacache), LIBXML_NOCDATA);
         $this->parseMeta($xml, $this->meta);
     }
     // collect appropriate rows for config
     $componentTable = new Blerby_Entity_Model_Component();
     $componentTableMeta = $componentTable->info();
     $this->meta->componentCols = array_keys($componentTableMeta['metadata']);
 }