本文整理汇总了PHP中Zend\Db\TableGateway\TableGateway::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP TableGateway::__construct方法的具体用法?PHP TableGateway::__construct怎么用?PHP TableGateway::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Db\TableGateway\TableGateway
的用法示例。
在下文中一共展示了TableGateway::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($adapter = null)
{
if ($adapter == null) {
$adapter = GlobalAdapterFeature::getStaticAdapter();
}
parent::__construct($this->tableName, $adapter);
}
示例2: __construct
public function __construct($name = null)
{
if ($name) {
$this->_tableName = $name;
}
parent::__construct($this->_tableName, $this->boot()->db);
}
示例3: __construct
public function __construct(DBEntity $object, AdapterInterface $adapter, $features = null)
{
$this->object = $object;
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype($object);
parent::__construct($object->getTableName(), $adapter, $features, $resultSetPrototype);
}
示例4: __construct
/**
*
* @param AdapterInterface $adapter
* @param EntityInterface $entity
*/
public function __construct(AdapterInterface $adapter, EntityInterface $entity)
{
$hydrator = new \Zend\Stdlib\Hydrator\ClassMethods();
$resultSet = new ResultSet($hydrator, $entity);
$this->entityPrototype = $entity;
parent::__construct($this->getTableName(), $adapter, null, $resultSet);
}
示例5: __construct
/**
* @param AdapterInterface $adapter
* @param CommonEntity $entity
*/
public function __construct($adapter, $entity)
{
parent::__construct($this->tableName, $adapter);
$this->hydrator = new Reflection();
$this->entityPrototype = $entity;
$this->adapter = $adapter;
}
示例6: __construct
/**
* Constructor
*
* @param AclProvider $acl
* @param string $table
* @param AdapterInterface $adapter
* @param Feature\AbstractFeature|Feature\FeatureSet|Feature\AbstractFeature[] $features
* @param ResultSetInterface $resultSetPrototype
* @param Sql $sql
* @throws Exception\InvalidArgumentException
*/
public function __construct(Acl $acl, $table, AdapterInterface $adapter, $features = null, ResultSetInterface $resultSetPrototype = null, Sql $sql = null, $primaryKeyName = null)
{
$this->acl = $acl;
if ($features !== null) {
if ($features instanceof Feature\AbstractFeature) {
$features = array($features);
}
if (is_array($features)) {
$this->featureSet = new Feature\FeatureSet($features);
} elseif ($features instanceof Feature\FeatureSet) {
$this->featureSet = $features;
} else {
throw new Exception\InvalidArgumentException('TableGateway expects $feature to be an instance of an AbstractFeature or a FeatureSet, or an array of AbstractFeatures');
}
} else {
$this->featureSet = new Feature\FeatureSet();
}
if ($primaryKeyName !== null) {
$this->primaryKeyFieldName = $primaryKeyName;
}
$rowGatewayPrototype = new AclAwareRowGateway($acl, $this->primaryKeyFieldName, $table, $adapter);
$rowGatewayFeature = new RowGatewayFeature($rowGatewayPrototype);
$this->featureSet->addFeature($rowGatewayFeature);
$this->memcache = new MemcacheProvider();
parent::__construct($table, $adapter, $this->featureSet, $resultSetPrototype, $sql);
}
示例7: __construct
/**
* Constructor
*
* @param string $tableName
* @param Adapter $masterAdapter
* @param Adapter $slaveAdapter
* @param type $databaseSchema
* @param ResultSet $selectResultPrototype
*/
public function __construct($tableName, Adapter $masterAdapter, Adapter $slaveAdapter, $databaseSchema = null, ResultSet $selectResultPrototype = null)
{
$this->masterAdapter = $masterAdapter;
$this->slaveAdapter = $slaveAdapter;
// initialize adapter to masterAdapter
parent::__construct($tableName, $masterAdapter, $databaseSchema, $selectResultPrototype);
}
示例8: __construct
public function __construct($adapter)
{
parent::__construct($this->tableName, $adapter, new RowGatewayFeature($this->idCol));
/* CREATE TABLE IF NOT EXISTS `t_pictures` (
`id` int( 11 ) NOT NULL AUTO_INCREMENT ,
`url_picture` varchar( 255 ) NOT NULL ,
PRIMARY KEY ( `id` )
)*/
}
示例9: __construct
public function __construct($table, Adapter $db, $strategies = array())
{
$hydrator = new ArraySerializable();
foreach ($strategies as $field => $strategy) {
$hydrator->addStrategy($field, $strategy);
}
$resultSet = new HydratingResultSet();
$resultSet->setHydrator($hydrator);
parent::__construct($table, $db, null, $resultSet);
}
示例10: __construct
public function __construct($adapter)
{
parent::__construct($this->tableName, $adapter, new RowGatewayFeature($this->idCol));
/* `t_article` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title_article` varchar(255) NOT NULL,
`short_article` text NOT NULL,
`full_article` text NOT NULL,
PRIMARY KEY (`id`)*/
}
示例11: __construct
public function __construct($adapter)
{
parent::__construct($this->tableName, $adapter, new RowGatewayFeature($this->idCol));
/* `id` int(11) NOT NULL AUTO_INCREMENT,
`id_group` int(11) NOT NULL,
`number_folio` varchar(255) NOT NULL,
`name_folio` varchar(255) NOT NULL,
`describe_folio` text NOT NULL,
`id_testimonials` int(11) NOT NULL,
`price_folio` int(11) NOT NULL,*/
}
示例12: __construct
public function __construct($adapter)
{
parent::__construct($this->tableName, $adapter, new RowGatewayFeature($this->idCol));
/*t_illustrates` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`url_illustrates` varchar(255) NOT NULL,
`id_article` int(11) NOT NULL,
PRIMARY KEY (`id`),
KEY `id_article` (`id_article`)
)*/
}
示例13: __construct
public function __construct($adapter)
{
parent::__construct($this->tableName, $adapter, new RowGatewayFeature($this->idCol));
/*`t_calc_sess` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`calc_sess` varchar(255) NOT NULL,
`calc_date` date NOT NULL,
`calc_data` text,
PRIMARY KEY (`id`),
UNIQUE KEY `calc_sess` (`calc_sess`)
)*/
}
示例14: __construct
public function __construct(AdapterInterface $adapter = null, $features = null, ResultSetInterface $resultSetPrototype = null, Sql $sql = null)
{
if ($adapter instanceof Adapter) {
parent::__construct($this->table, $adapter, $features, $resultSetPrototype, $sql);
} else {
$adapter = Registry::get('db');
if ($adapter instanceof Adapter) {
parent::__construct($this->table, $adapter);
} else {
throw new Exception("Need an Zend\\Db\\Adapter object.");
}
}
}
示例15: __construct
public function __construct($adapter)
{
parent::__construct($this->tableName, $adapter, new RowGatewayFeature($this->idCol));
//$testimonialsSrv = $this -> getServiceLocator()->get('testimonials');
/*`t_testimonials` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name_testimonials` varchar(255) NOT NULL,
`organization` varchar(255) NOT NULL,
`id_picture` int(11) NOT NULL,
`text_testimonials` text NOT NULL,
`short_text_testimonials` text NOT NULL,
`public_on_home_testimonials` tinyint(4) NOT NULL,*/
}