Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Table.php
Go to the documentation of this file.
1 <?php
26 #require_once 'Zend/Db/Table/Abstract.php';
27 
31 #require_once 'Zend/Db/Table/Definition.php';
32 
43 {
44 
52  public function __construct($config = array(), $definition = null)
53  {
54  if ($definition !== null && is_array($definition)) {
55  $definition = new Zend_Db_Table_Definition($definition);
56  }
57 
58  if (is_string($config)) {
60  trigger_error(__CLASS__ . '::' . __METHOD__ . '(\'registryName\') is not valid usage of Zend_Db_Table, '
61  . 'try extending Zend_Db_Table_Abstract in your extending classes.',
62  E_USER_NOTICE
63  );
64  $config = array(self::ADAPTER => $config);
65  } else {
66  // process this as table with or without a definition
67  if ($definition instanceof Zend_Db_Table_Definition
68  && $definition->hasTableConfig($config)) {
69  // this will have DEFINITION_CONFIG_NAME & DEFINITION
70  $config = $definition->getTableConfig($config);
71  } else {
72  $config = array(self::NAME => $config);
73  }
74  }
75  }
76 
77  parent::__construct($config);
78  }
79 }
__construct($config=array(), $definition=null)
Definition: Table.php:52
$config
Definition: fraud_order.php:17
hasTableConfig($tableName)
Definition: Definition.php:126
static isRegistered($index)
Definition: Registry.php:178