当前位置: 首页>>代码示例>>PHP>>正文


PHP TableGateway\TableGateway类代码示例

本文整理汇总了PHP中Zend\Db\TableGateway\TableGateway的典型用法代码示例。如果您正苦于以下问题:PHP TableGateway类的具体用法?PHP TableGateway怎么用?PHP TableGateway使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了TableGateway类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveCommandeProduit

 public function saveCommandeProduit($id, $ajouterCommande, $prixproduit)
 {
     $data = array('COMMANDE_ID' => $id, 'PRODUIT_ID' => $ajouterCommande, 'COMMANDEPRODUIT_PRIX' => $prixproduit);
     $adapter = $this->tableGateway->getAdapter();
     $otherTable = new TableGateway('commandeproduit', $adapter);
     $otherTable->insert($data);
 }
开发者ID:JohannesGirard,项目名称:WebCashRegister-zf2,代码行数:7,代码来源:CommandeproduitTable.php

示例2: save

 /**
  * Save Role
  *
  * @return integer
  */
 public function save()
 {
     $this->events()->trigger(__CLASS__, 'before.save', $this);
     $arraySave = array('name' => $this->getName(), 'description' => $this->getDescription());
     try {
         $roleId = $this->getId();
         if (empty($roleId)) {
             $this->insert($arraySave);
             $this->setId($this->getLastInsertId());
         } else {
             $this->update($arraySave, array('id' => $this->getId()));
         }
         $permissions = $this->getPermissions();
         if (!empty($permissions)) {
             $aclTable = new TableGateway('user_acl', $this->getAdapter());
             $aclTable->delete(array('user_acl_role_id' => $this->getId()));
             foreach ($permissions as $permissionId => $value) {
                 if (!empty($value)) {
                     $aclTable->insert(array('user_acl_role_id' => $this->getId(), 'user_acl_permission_id' => $permissionId));
                 }
             }
         }
         $this->events()->trigger(__CLASS__, 'after.save', $this);
         return $this->getId();
     } catch (\Exception $e) {
         $this->events()->trigger(__CLASS__, 'after.save.failed', $this);
         throw new \Gc\Exception($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:gotcms,项目名称:gotcms,代码行数:34,代码来源:Model.php

示例3: fetchAll

 /**
  * @param bool $paginated
  * @param string $filter
  * @param string $orderBy
  * @param string $order
  * @return \Zend\Db\ResultSet\ResultSet|\Zend\Paginator\Paginator
  * @throws \Exception
  */
 public function fetchAll($paginated = false, $filter = '', $orderBy = 'attendanceDate', $order = 'DESC')
 {
     if ($paginated) {
         return $this->paginate($filter, $orderBy, $order, $this->boardView);
     }
     $attendanceBoard = new TableGateway($this->boardView, $this->adapter);
     return $attendanceBoard->select();
 }
开发者ID:khinmyatkyi,项目名称:Office_Management,代码行数:16,代码来源:AttendanceDataAccess.php

示例4: fetchAll

 /**
  * @param bool $paginated
  * @param string $filter
  * @param string $orderBy
  * @param string $order
  * @return \Zend\Db\ResultSet\ResultSet
  * @throws \Exception
  */
 public function fetchAll($paginated = false, $filter = '', $orderBy = 'contractBy', $order = 'ASC')
 {
     if ($paginated) {
         $this->paginate($filter, $orderBy, $order);
     }
     $contractView = new TableGateway($this->table, $this->adapter);
     return $contractView->select(array('contract' => $this->staffId));
 }
开发者ID:khinmyatkyi,项目名称:Office_Management,代码行数:16,代码来源:ContractDataAccess.php

示例5: fetchAll

 /**
  * @param bool $paginated
  * @param string $filter
  * @param string $orderBy
  * @param string $order
  * @return \Zend\Db\ResultSet\ResultSet|Paginator
  * @throws \Exception
  */
 public function fetchAll($paginated = false, $filter = '', $orderBy = 'name', $order = 'ASC')
 {
     $view = 'vw_hr_position';
     if ($paginated) {
         return $this->paginate($filter, $orderBy, $order, $view);
     }
     $tableGateway = new TableGateway($view, $this->adapter);
     return $tableGateway->select();
 }
开发者ID:khinmyatkyi,项目名称:Office_Management,代码行数:17,代码来源:PositionDataAccess.php

示例6: fetchAll

 /**
  * @param bool $paginated
  * @param string $filter
  * @param string $orderBy
  * @param string $order
  * @return \Zend\Db\ResultSet\ResultSet|\Zend\Paginator\Paginator
  * @throws \Exception
  */
 public function fetchAll($paginated = false, $filter = '', $orderBy = 'proposalDate', $order = 'ASC')
 {
     $view = 'vw_cr_proposal';
     if ($paginated) {
         return $this->paginate($filter, $orderBy, $order, $view);
     }
     $proposalView = new TableGateway($view, $this->adapter);
     return $proposalView->select(array('proposalBy' => $this->staffId));
 }
开发者ID:khinmyatkyi,项目名称:Office_Management,代码行数:17,代码来源:ProposalDataAccess.php

示例7: fetchAll

 /**
  * @param bool $paginated
  * @param string $filter
  * @param string $orderBy
  * @param string $order
  * @return \Zend\Db\ResultSet\ResultSet|\Zend\Paginator\Paginator
  * @throws \Exception
  */
 public function fetchAll($paginated = false, $filter = '', $orderBy = 'contactName', $order = 'ASC')
 {
     $view = 'vw_cr_contact';
     if ($paginated) {
         return $this->paginate($filter, $orderBy, $order, $view);
     }
     $contactView = new TableGateway($view, $this->adapter);
     return $contactView->select();
 }
开发者ID:khinmyatkyi,项目名称:Office_Management,代码行数:17,代码来源:ContactDataAccess.php

示例8: __construct

 /**
  * Constructs instance.
  *
  * @param TableGateway                $tableGateway
  * @param Where|\Closure|string|array $where
  * @param null                        $order
  */
 public function __construct(TableGateway $tableGateway, $where = null, $order = null)
 {
     $select = $tableGateway->getSql()->select();
     if ($where) {
         $select->where($where);
     }
     if ($order) {
         $select->order($order);
     }
     $dbAdapter = $tableGateway->getAdapter();
     $resultSetPrototype = $tableGateway->getResultSetPrototype();
     parent::__construct($select, $dbAdapter, $resultSetPrototype);
 }
开发者ID:idwsdta,项目名称:INIT-frame,代码行数:20,代码来源:DbTableGateway.php

示例9: testGetRolesWithInheritance

 /**
  * @covers \BjyAuthorize\Provider\Role\ZendDb::getRoles
  */
 public function testGetRolesWithInheritance()
 {
     $this->tableGateway->expects($this->any())->method('selectWith')->will($this->returnValue(array(array('id' => 1, 'role_id' => 'guest', 'is_default' => 1, 'parent_id' => null), array('id' => 2, 'role_id' => 'user', 'is_default' => 0, 'parent_id' => 1))));
     $this->serviceLocator->expects($this->any())->method('get')->will($this->returnValue($this->tableGateway));
     $provider = new ZendDb(array(), $this->serviceLocator);
     $this->assertEquals($provider->getRoles(), array(new Role('guest'), new Role('user', 'guest')));
 }
开发者ID:pbrilius,项目名称:BjyAuthorize,代码行数:10,代码来源:ZendDbTest.php

示例10: getCityById

 /**
  * @param $id
  * @return City|null
  */
 public function getCityById($id)
 {
     $city = $this->cityTable->select(['ID' => $id]);
     if ($city->count() < 1) {
         return null;
     }
     return $city->current();
 }
开发者ID:GeeH,项目名称:bad-puppy,代码行数:12,代码来源:DataService.php

示例11: deleteCategory

 public function deleteCategory($id)
 {
     try {
         return $this->tableGateway->delete(array('id_category' => $id));
     } catch (InvalidQueryException $e) {
         return 0;
     }
 }
开发者ID:Lebe1ge,项目名称:JobeetForZF2,代码行数:8,代码来源:CategoryTable.php

示例12: _initObject

 /**
  * This method init $this->object
  */
 protected function _initObject($data = null)
 {
     if (is_null($data)) {
         $data = $this->_itemsArrayDelault;
     }
     $this->_prepareTable($data);
     $this->dbTable->insert($data);
 }
开发者ID:avz-cmf,项目名称:zaboy-rest,代码行数:11,代码来源:DbTableMultiInsertTest.php

示例13: testSave

 public function testSave()
 {
     //Insert
     $data = new ArrayObject(['fullName' => 'Test', 'email' => 'test@test.com']);
     $this->assertEquals(1, $this->table->save($data));
     $this->assertNotNull($data['id']);
     //Update
     $data = new ArrayObject(['id' => 1, 'fullName' => 'TestUser' . rand(10, 99), 'email' => 'test@test.com']);
     $this->assertEquals(1, $this->table->save($data));
 }
开发者ID:zfegg,项目名称:zend-db-feature,代码行数:10,代码来源:CommonCallFeatureTest.php

示例14: getCurrentVersion

 public function getCurrentVersion($mdir_md5)
 {
     $select = new Select($this->tableGateway->getTable());
     $select->where(array('mdir_md5' => $mdir_md5))->order('version DESC')->limit(1);
     $result = $this->tableGateway->selectWith($select);
     if (!$result->count()) {
         return 0;
     }
     return $result->current()->getVersion();
 }
开发者ID:ycheukf,项目名称:migration,代码行数:10,代码来源:MigrationVersionTable.php

示例15: getCurrentVersion

 public function getCurrentVersion()
 {
     $result = $this->tableGateway->select(function (Select $select) {
         $select->order('version DESC')->limit(1);
     });
     if (!$result->count()) {
         return 0;
     }
     return $result->current()->getVersion();
 }
开发者ID:dpoltoratsky,项目名称:ZfSimpleMigrations,代码行数:10,代码来源:MigrationVersionTable.php


注:本文中的Zend\Db\TableGateway\TableGateway类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。