function push(&$mMixed)
 {
     if (!\Flake\Util\Tools::is_a($mMixed, $this->sTypeClassOrProtocol)) {
         throw new \Exception("\\Flake\\Core\\CollectionTyped<" . $this->sTypeClassOrProtocol . ">: Given object is not correctly typed.");
     }
     parent::push($mMixed);
 }
示例#2
0
 public function setModelInstance($oModelInstance)
 {
     if (!\Flake\Util\Tools::is_a($oModelInstance, $this->sModelClass)) {
         throw new \Exception("\\Formal\\Core->setModelInstance(): Given instance is not of class '" . $this->sModelClass . "'");
     }
     $this->oModelInstance = $oModelInstance;
     $this->oElements->reset();
     foreach ($this->oElements as $oElement) {
         $oElement->setValue($this->modelInstance()->get($oElement->option("prop")));
     }
     # Displayed form title is generated depending on modelInstance floatingness
     if ($this->floatingModelInstance()) {
         $this->sDisplayTitle = "Creating new<i class=" . $this->modelInstance()->mediumicon() . "></i><strong>" . $this->modelInstance()->humanName() . "</strong>";
     } else {
         # This is changed if form is persisted, after persistance, to reflect possible change in model instance label
         $this->sDisplayTitle = "Editing " . $this->modelInstance()->humanName() . "<i class=" . $this->modelInstance()->mediumicon() . "></i><strong>" . $this->modelInstance()->label() . "</strong>";
     }
     return $this;
 }
示例#3
0
 public static function isDBInitialized()
 {
     return isset($GLOBALS["DB"]) && \Flake\Util\Tools::is_a($GLOBALS["DB"], "\\Flake\\Core\\Database");
 }
示例#4
0
 function isA($sClassOrProtocolName)
 {
     return \Flake\Util\Tools::is_a($this, $sClassOrProtocolName);
 }