本文整理汇总了PHP中DataMapper::_get_without_auto_populating方法的典型用法代码示例。如果您正苦于以下问题:PHP DataMapper::_get_without_auto_populating方法的具体用法?PHP DataMapper::_get_without_auto_populating怎么用?PHP DataMapper::_get_without_auto_populating使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataMapper
的用法示例。
在下文中一共展示了DataMapper::_get_without_auto_populating方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _to_object
/**
* To Object
* Copies the values from a query result row to an object.
* Also initializes that object by running get rules, and
* refreshing stored values on the object.
*
* Finally, if any "instantiations" are requested, those related objects
* are created off of query results
*
* This is only public so that the iterator can access it.
*
* @ignore
* @param DataMapper $item Item to configure
* @param object $row Query results
*/
public function _to_object($item, $row)
{
// Populate this object with values from first record
foreach ($row as $key => $value) {
$item->{$key} = $value;
}
foreach ($this->fields as $field) {
if (!isset($row->{$field})) {
$item->{$field} = NULL;
}
}
// Force IDs to integers
foreach ($this->_field_tracking['intval'] as $field) {
if (isset($item->{$field})) {
$item->{$field} = intval($item->{$field});
}
}
if (!empty($this->_field_tracking['get_rules'])) {
$item->_run_get_rules();
}
$item->_refresh_stored_values();
if ($this->_instantiations) {
foreach ($this->_instantiations as $related_field => $field_map) {
// convert fields to a 'row' object
$row = new stdClass();
foreach ($field_map as $item_field => $c_field) {
$row->{$c_field} = $item->{$item_field};
}
// get the related item
$c =& $item->_get_without_auto_populating($related_field);
// set the values
$c->_to_object($c, $row);
// also set up the ->all array
$c->all = array();
$c->all[0] = $c->get_clone();
}
}
}