本文整理汇总了PHP中F0FTable::bind方法的典型用法代码示例。如果您正苦于以下问题:PHP F0FTable::bind方法的具体用法?PHP F0FTable::bind怎么用?PHP F0FTable::bind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类F0FTable
的用法示例。
在下文中一共展示了F0FTable::bind方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTable
/**
* Returns the data in $this->_current as a F0FTable instance
*
* @return F0FTable
*
* @throws OutOfBoundsException
*/
protected function getTable()
{
if (!$this->valid()) {
throw new OutOfBoundsException('Cannot get item past iterator\'s bounds', 500);
}
$this->_tableObject->bind($this->_current);
return $this->_tableObject;
}
示例2:
/**
* Returns a single item. It uses the id set with setId, or the first ID in
* the list of IDs for batch operations
*
* @param integer $id Force a primary key ID to the model. Use null to use the id from the state.
*
* @return F0FTable A copy of the item's F0FTable array
*/
public function &getItem($id = null)
{
if (!is_null($id)) {
$this->record = null;
$this->setId($id);
}
if (empty($this->record)) {
$table = $this->getTable($this->table);
$table->load($this->id);
$this->record = $table;
// Do we have saved data?
$session = JFactory::getSession();
if ($this->_savestate) {
$serialized = $session->get($this->getHash() . 'savedata', null);
if (!empty($serialized)) {
$data = @unserialize($serialized);
if ($data !== false) {
$k = $table->getKeyName();
if (!array_key_exists($k, $data)) {
$data[$k] = null;
}
if ($data[$k] != $this->id) {
$session->set($this->getHash() . 'savedata', null);
} else {
$this->record->bind($data);
}
}
}
}
$this->onAfterGetItem($this->record);
}
return $this->record;
}