本文整理汇总了PHP中Kwf_Model_Abstract::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwf_Model_Abstract::__construct方法的具体用法?PHP Kwf_Model_Abstract::__construct怎么用?PHP Kwf_Model_Abstract::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kwf_Model_Abstract
的用法示例。
在下文中一共展示了Kwf_Model_Abstract::__construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $config = array())
{
if (isset($config['amazon'])) {
$this->_amazon = (array) $config['amazon'];
}
parent::__construct($config);
}
示例2: __construct
public function __construct(array $config = array())
{
if (isset($config['proxyModel'])) {
$this->_proxyModel = $config['proxyModel'];
}
parent::__construct($config);
}
示例3: __construct
public function __construct(array $config = array())
{
if (isset($config['fieldName'])) {
$this->_fieldName = $config['fieldName'];
}
if (isset($config['columns'])) {
$this->_columns = (array) $config['columns'];
}
parent::__construct($config);
}
示例4: __construct
public function __construct(array $config = array())
{
if (!isset($config['db'])) {
$config['db'] = Kwf_Registry::get('dao')->getMongoDb();
}
if (isset($config['collection'])) {
$this->_collection = $config['collection'];
}
if (is_string($this->_collection)) {
$this->_collection = $config['db']->{$this->_collection};
}
parent::__construct($config);
}
示例5: __construct
public function __construct($config = array())
{
if (isset($config['tableName'])) {
$this->_table = new $config['tableName']();
}
if (isset($config['table'])) {
$this->_table = $config['table'];
}
if (isset($config['db'])) {
$this->_db = $config['db'];
}
parent::__construct($config);
}
示例6: __construct
public function __construct(array $config = array())
{
if (isset($config['models'])) {
$this->_models = (array) $config['models'];
}
if (isset($config['columnMapping'])) {
$this->_columnMapping = $config['columnMapping'];
}
if (!$this->_models) {
throw new Kwf_Exception("models setting is required");
}
if (!$this->_columnMapping) {
throw new Kwf_Exception("columnMapping setting is required");
}
$allDb = true;
foreach ($this->_models as $k => $i) {
if (is_numeric(substr($k, -1))) {
if (!$this->_columnMapping) {
throw new Kwf_Exception("model key '{$k}' must not end numeric");
}
}
foreach (array_keys($this->_models) as $key) {
if ($key != $k && substr($k, 0, strlen($key)) == $key) {
throw new Kwf_Exception("Invalid key '{$k}', another key ('{$key}') also starts with this string");
}
}
if (is_array($i)) {
if (!isset($i['model'])) {
throw new Kwf_Exception("model key for models setting is required");
}
if (isset($i['select'])) {
$this->_mergeSelects[$k] = $i['select'];
}
$i = $i['model'];
}
$i = Kwf_Model_Abstract::getInstance($i);
$this->_models[$k] = $i;
if (!$i->getFactoryConfig()) {
$i->setFactoryConfig(array('type' => 'UnionSource', 'union' => $this, 'modelKey' => $k));
}
while ($i instanceof Kwf_Model_Proxy) {
$i = $i->getProxyModel();
}
if (!$i instanceof Kwf_Model_Db) {
$allDb = false;
}
}
$this->_allDb = $allDb;
parent::__construct($config);
}
示例7: __construct
public function __construct(array $config = array())
{
if (!isset($config['filename'])) {
throw new Kwf_Exception('No CSV file found');
}
if (isset($config['headRow'])) {
$this->_headRow = $config['headRow'];
}
if (!isset($config['delimiter'])) {
throw new Kwf_Exception('Please set a delimiter');
}
$this->_filename = $config['filename'];
$this->_delimiter = $config['delimiter'];
parent::__construct($config);
}
示例8: __construct
public function __construct(array $config = array())
{
if (isset($config['data'])) {
$this->setData($config['data']);
}
if (isset($config['autoId'])) {
(int) ($this->_autoId = $config['autoId']);
}
if (isset($config['columns'])) {
$this->_columns = (array) $config['columns'];
}
if (isset($config['primaryKey'])) {
$this->_primaryKey = (string) $config['primaryKey'];
}
if (isset($config['uniqueColumns'])) {
$this->_uniqueColumns = (array) $config['uniqueColumns'];
}
parent::__construct($config);
}