本文整理汇总了PHP中xepan\base\Model_Table::load方法的典型用法代码示例。如果您正苦于以下问题:PHP Model_Table::load方法的具体用法?PHP Model_Table::load怎么用?PHP Model_Table::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xepan\base\Model_Table
的用法示例。
在下文中一共展示了Model_Table::load方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: load
function load($id_name)
{
if (is_numeric($id_name)) {
return parent::load($id_name);
}
$this->unload();
$this->tryLoadBy('name', $id_name);
if ($this->loaded()) {
return $this;
}
foreach ($this->defaultGroups as $group) {
if ($group['name'] == $id_name) {
// balancesheet id set and parent id set if in array
if ($group['parent_group']) {
$group['parent_group_id'] = $this->newInstance()->load($group['parent_group'])->get('id');
}
if ($group['root_group']) {
$group['root_group_id'] = $this->newInstance()->load($group['root_group'])->get('id');
}
$group['balance_sheet_id'] = $this->add('xepan\\accounts\\Model_BalanceSheet')->load($group['balance_sheet'])->get('id');
$this->set($group)->save();
return $this;
}
}
throw $this->exception('Could Not Load Group');
}
示例2: load
function load($id_name)
{
if (is_numeric($id_name)) {
return parent::load($id_name);
}
$this->unload();
$this->tryLoadBy('name', $id_name);
if ($this->loaded()) {
return $this;
}
foreach ($this->defaultHeads as $acc) {
if ($acc['name'] == $id_name) {
$this->set($acc)->save();
return $this;
}
}
throw $this->exception('Could Not Load Balancesheet Head');
}
示例3: load
function load($id_name)
{
if (is_numeric($id_name)) {
return parent::load($id_name);
}
$this->unload();
$this->tryLoadBy('name', $id_name);
if ($this->loaded()) {
return $this;
}
foreach ($this->defaultLedger as $ledger) {
if ($ledger['name'] == $id_name) {
// group id set
$ledger['group_id'] = $this->add('xepan\\accounts\\Model_Group')->load($ledger['group'])->get('id');
$this->set($ledger)->save();
return $this;
}
}
throw $this->exception('Could Not Load Ledger');
}