Ferreteria/v0.3/class/cPortalRow storage

From Woozle Writes Code
< Ferreteria‎ | v0.3‎ | class
Revision as of 20:47, 28 December 2018 by htyp>Woozle (extenders)
Jump to navigation Jump to search

Template:Page/code/class

class cPortalRow_storage extends cPortalRow implements ifLoadableRows {
    use tLoadableRow;   // lets DB store its resource-blob

    protected function GetPortalType() {
        return cIOField::ksPortalStorage;
    }
    protected function SetPortals_fromFields(array $arFields) {
        if (count($arFields) == 0) {
            throw new \exception('Attempting to set Portals with an empty field-list.');
        } else {
            foreach ($arFields as $sKey => $oField) {
                $oPortal = $oField->MakePortal($this->GetPortalType());
                $this->arPortals[$sKey] = $oPortal;
            }
        }
    }
}