本文整理汇总了PHP中Zend\Db\ResultSet\HydratingResultSet::setObjectPrototype方法的典型用法代码示例。如果您正苦于以下问题:PHP HydratingResultSet::setObjectPrototype方法的具体用法?PHP HydratingResultSet::setObjectPrototype怎么用?PHP HydratingResultSet::setObjectPrototype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Db\ResultSet\HydratingResultSet
的用法示例。
在下文中一共展示了HydratingResultSet::setObjectPrototype方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getResultSet
/**
* @return HydratingResultSet
*/
protected function getResultSet()
{
if (!$this->resultSetPrototype) {
$this->resultSetPrototype = new HydratingResultSet();
$this->resultSetPrototype->setHydrator($this->getHydrator());
$this->resultSetPrototype->setObjectPrototype($this->getEntityPrototype());
}
return clone $this->resultSetPrototype;
}
示例2: createService
public function createService(ServiceLocatorInterface $serviceLocator)
{
$db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new UserSkills());
$tableGateway = new TableGateway('vc_user_skills', $db, array(), $resultSetPrototype);
$table = new UserSkillsTable($tableGateway);
return $table;
}
示例3: createService
public function createService(ServiceLocatorInterface $serviceLocator)
{
$db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new Resource());
$tableGateway = new TableGateway('resource', $db, null, $resultSetPrototype);
$table = new ResourceTable($tableGateway);
return $table;
}
示例4: createService
public function createService(ServiceLocatorInterface $serviceLocator)
{
$db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new ViewProfileCount());
$tableGateway = new TableGateway('vc_view_profiles_count', $db, array(), $resultSetPrototype);
$table = new ViewProfileCountTable($tableGateway);
return $table;
}
示例5: createService
public function createService(ServiceLocatorInterface $serviceLocator)
{
$db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new ForgotPassword());
$tableGateway = new TableGateway('vc_forget_tokens', $db, array(), $resultSetPrototype);
$table = new ForgotPasswordTable($tableGateway);
return $table;
}
示例6: createService
public function createService(ServiceLocatorInterface $serviceLocator)
{
$db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new JsPlumbGrid());
$tableGateway = new TableGateway('js_plumb_grid', $db, array(), $resultSetPrototype);
$table = new JsPlumbGridTable($tableGateway);
return $table;
}
示例7: getResultSet
/**
* gets the resultSet
*
* @return HydratingResultSet
*/
protected function getResultSet()
{
if (!$this->resultSetPrototype instanceof HydratingResultSet) {
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator($this->getHydrator());
$resultSetPrototype->setObjectPrototype($this->getModel());
$this->resultSetPrototype = $resultSetPrototype;
}
return clone $this->resultSetPrototype;
}
示例8: createService
public function createService(ServiceLocatorInterface $serviceLocator)
{
$db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new SearchCategoriesList());
$tableGateway = new TableGateway('search_categories_list', $db, array(), $resultSetPrototype);
$table = new SearchCategoriesListTable($tableGateway);
return $table;
}
示例9: createService
public function createService(ServiceLocatorInterface $serviceLocator)
{
$db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new SettingFlexibleType());
$tableGateway = new TableGateway('setting_flexible_type', $db, array(), $resultSetPrototype);
$table = new SettingFlexibleTypeTable($tableGateway);
return $table;
}
示例10: createService
public function createService(ServiceLocatorInterface $serviceLocator)
{
$db = $serviceLocator->get('Zend\\Db\\Adapter\\Adapter');
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new LoginLinkExpired());
$tableGateway = new TableGateway('login_link_expired', $db, array(), $resultSetPrototype);
$table = new LoginLinkExpiredTable($tableGateway);
return $table;
}
示例11: createService
public function createService(ServiceLocatorInterface $serviceLocator)
{
$db = $serviceLocator->get('Zend\\Db\\Adapter');
$entity = new User();
$set = new HydratingResultSet();
$set->setObjectPrototype($entity);
$set->setHydrator(new ClassMethods());
$tableGateway = new TableGateway('User', $db, null, $set);
$mapper = new UserMapper($tableGateway);
return $mapper;
}
示例12: fetchAll
public function fetchAll($filter)
{
$select = new Select('album');
if (isset($filter['title'])) {
$select->where(array('title LIKE ?' => '%' . $filter['title'] . '%'));
}
$resultset = new HydratingResultSet();
$resultset->setObjectPrototype(new AlbumEntity());
$paginatorAdapter = new DbSelect($select, $this->adapterSlave, $resultset);
$collection = new AlbumCollection($paginatorAdapter);
return $collection;
}
示例13: getHydrator
/**
* @param $requestedName
* @return HydratingResultSet|ResultSet
*/
public function getHydrator($requestedName)
{
$hydrator = $this->getHydratorOrModel($requestedName, 'Hydrator');
if ($hydrator) {
$hydrator->setTablePrefix($this->tableNamesMap[$requestedName]);
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator($hydrator);
$resultSetPrototype->setObjectPrototype($this->getModel($requestedName));
} else {
$resultSetPrototype = new ResultSet();
}
return $resultSetPrototype;
}
示例14: getServiceConfig
public function getServiceConfig()
{
return array("factories" => array("GroupTableGateway" => function ($sm) {
$adapter = $sm->get("dbConfig");
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new \ZendVN\Model\Entity\Group());
return $tableGateway = new TableGateway("groups", $adapter, null, $resultSetPrototype);
}, "Admin\\Model\\Group" => function ($sm) {
$tableGateway = $sm->get("GroupTableGateway");
return new \Admin\Model\GroupTable($tableGateway);
}, "UserTableGateway" => function ($sm) {
$adapter = $sm->get("dbConfig");
//hydratingResultSet()---->lấy field từ các bảng khác không cần đưa vào entities
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new \ZendVN\Model\Entity\User());
return $tableGateway = new TableGateway("user", $adapter, null, $resultSetPrototype);
}, "Admin\\Model\\User" => function ($sm) {
$tableGateway = $sm->get("UserTableGateway");
return new \Admin\Model\UserTable($tableGateway);
}, "NestedTableGateway" => function ($sm) {
$adapter = $sm->get("dbConfig");
//hydratingResultSet()---->lấy field từ các bảng khác không cần đưa vào entities
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new \ZendVN\Model\Entity\Nested());
return $tableGateway = new TableGateway("nested", $adapter, null, $resultSetPrototype);
}, "Admin\\Model\\Nested" => function ($sm) {
$tableGateway = $sm->get("NestedTableGateway");
return new \Admin\Model\NestedTable($tableGateway);
}, "CategoryTableGateway" => function ($sm) {
$adapter = $sm->get("dbConfig");
//hydratingResultSet()---->lấy field từ các bảng khác không cần đưa vào entities
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new \ZendVN\Model\Entity\Category());
return $tableGateway = new TableGateway("category", $adapter, null, $resultSetPrototype);
}, "Admin\\Model\\Category" => function ($sm) {
$tableGateway = $sm->get("CategoryTableGateway");
return new \Admin\Model\CategoryTable($tableGateway);
}, "BookTableGateway" => function ($sm) {
$adapter = $sm->get("dbConfig");
//hydratingResultSet()---->lấy field từ các bảng khác không cần đưa vào entities
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new \ZendVN\Model\Entity\Book());
return $tableGateway = new TableGateway("book", $adapter, null, $resultSetPrototype);
}, "Admin\\Model\\Book" => function ($sm) {
$tableGateway = $sm->get("BookTableGateway");
return new \Admin\Model\BookTable($tableGateway);
}, "SliderTableGateway" => function ($sm) {
$adapter = $sm->get("dbConfig");
//hydratingResultSet()---->lấy field từ các bảng khác không cần đưa vào entities
$resultSetPrototype = new HydratingResultSet();
$resultSetPrototype->setHydrator(new ObjectProperty());
$resultSetPrototype->setObjectPrototype(new \ZendVN\Model\Entity\Slider());
return $tableGateway = new TableGateway("slider", $adapter, null, $resultSetPrototype);
}, "Admin\\Model\\Slider" => function ($sm) {
$tableGateway = $sm->get("SliderTableGateway");
return new \Admin\Model\SliderTable($tableGateway);
}), "aliases" => array("GroupTable" => "Admin\\Model\\Group", "UserTable" => "Admin\\Model\\User", "NestedTable" => "Admin\\Model\\Nested", "CategoryTable" => "Admin\\Model\\Category", "BookTable" => "Admin\\Model\\Book", "SliderTable" => "Admin\\Model\\Slider"));
}