本文整理汇总了PHP中oxBase::init方法的典型用法代码示例。如果您正苦于以下问题:PHP oxBase::init方法的具体用法?PHP oxBase::init怎么用?PHP oxBase::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oxBase
的用法示例。
在下文中一共展示了oxBase::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBaseObject
/**
* Initializes or returns existing list template object.
*
* @return oxBase
*/
public function getBaseObject()
{
if (!$this->_oBaseObject) {
$this->_oBaseObject = oxNew($this->_sObjectsInListName);
$this->_oBaseObject->setInList();
$this->_oBaseObject->init($this->_sCoreTable);
}
return $this->_oBaseObject;
}
示例2: init
/**
* Sets the names to main and view tables, loads metadata of each table.
*
* @param string $sTableName Name of DB object table
* @param bool $blForceAllFields Forces initialisation of all fields overriding lazy loading functionality
*
* @return null
*/
public function init($sTableName = null, $blForceAllFields = false)
{
//$this->_sCacheKey = null;
return parent::init($sTableName, $blForceAllFields);
}
示例3: createObj2Obj
/**
* Create object 2 object connection in databse
*
* @param array $aData db fields and values
* @param string $sObj2ObjTable table name
*/
public function createObj2Obj($aData, $sObj2ObjTable)
{
if (empty($aData)) {
return;
}
$iCnt = count($aData);
for ($i = 0; $i < $iCnt; $i++) {
$oObj = new oxBase();
$oObj->init($sObj2ObjTable);
if ($iCnt < 2) {
$aObj = $aData[$i];
} else {
$aObj = $aData;
}
foreach ($aObj as $sKey => $sValue) {
$sField = $sObj2ObjTable . "__" . $sKey;
$oObj->{$sField} = new oxField($sValue, oxField::T_RAW);
}
$oObj->save();
}
}