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); }
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; }
public static function isDBInitialized() { return isset($GLOBALS["DB"]) && \Flake\Util\Tools::is_a($GLOBALS["DB"], "\\Flake\\Core\\Database"); }
function isA($sClassOrProtocolName) { return \Flake\Util\Tools::is_a($this, $sClassOrProtocolName); }