Mercurial > hg > isophonics-drupal-site
comparison vendor/zendframework/zend-feed/src/PubSubHubbub/Model/AbstractModel.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 /** | |
3 * Zend Framework (http://framework.zend.com/) | |
4 * | |
5 * @link http://github.com/zendframework/zf2 for the canonical source repository | |
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) | |
7 * @license http://framework.zend.com/license/new-bsd New BSD License | |
8 */ | |
9 | |
10 namespace Zend\Feed\PubSubHubbub\Model; | |
11 | |
12 use Zend\Db\TableGateway\TableGateway; | |
13 use Zend\Db\TableGateway\TableGatewayInterface; | |
14 | |
15 class AbstractModel | |
16 { | |
17 /** | |
18 * Zend\Db\TableGateway\TableGatewayInterface instance to host database methods | |
19 * | |
20 * @var TableGatewayInterface | |
21 */ | |
22 protected $db = null; | |
23 | |
24 /** | |
25 * Constructor | |
26 * | |
27 * @param null|TableGatewayInterface $tableGateway | |
28 */ | |
29 public function __construct(TableGatewayInterface $tableGateway = null) | |
30 { | |
31 if ($tableGateway === null) { | |
32 $parts = explode('\\', get_class($this)); | |
33 $table = strtolower(array_pop($parts)); | |
34 $this->db = new TableGateway($table, null); | |
35 } else { | |
36 $this->db = $tableGateway; | |
37 } | |
38 } | |
39 } |