Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Abstract.php
Go to the documentation of this file.
1 <?php
26 #require_once 'Zend/Db.php';
27 
35 abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess, IteratorAggregate
36 {
37 
45  protected $_data = array();
46 
54  protected $_cleanData = array();
55 
62  protected $_modifiedFields = array();
63 
69  protected $_table = null;
70 
78  protected $_connected = true;
79 
87  protected $_readOnly = false;
88 
94  protected $_tableClass = null;
95 
101  protected $_primary;
102 
114  public function __construct(array $config = array())
115  {
116  if (isset($config['table']) && $config['table'] instanceof Zend_Db_Table_Abstract) {
117  $this->_table = $config['table'];
118  $this->_tableClass = get_class($this->_table);
119  } elseif ($this->_tableClass !== null) {
120  $this->_table = $this->_getTableFromString($this->_tableClass);
121  }
122 
123  if (isset($config['data'])) {
124  if (!is_array($config['data'])) {
125  #require_once 'Zend/Db/Table/Row/Exception.php';
126  throw new Zend_Db_Table_Row_Exception('Data must be an array');
127  }
128  $this->_data = $config['data'];
129  }
130  if (isset($config['stored']) && $config['stored'] === true) {
131  $this->_cleanData = $this->_data;
132  }
133 
134  if (isset($config['readOnly']) && $config['readOnly'] === true) {
135  $this->setReadOnly(true);
136  }
137 
138  // Retrieve primary keys from table schema
139  if (($table = $this->_getTable())) {
140  $info = $table->info();
141  $this->_primary = (array) $info['primary'];
142  }
143 
144  $this->init();
145  }
146 
157  protected function _transformColumn($columnName)
158  {
159  if (!is_string($columnName)) {
160  #require_once 'Zend/Db/Table/Row/Exception.php';
161  throw new Zend_Db_Table_Row_Exception('Specified column is not a string');
162  }
163  // Perform no transformation by default
164  return $columnName;
165  }
166 
174  public function __get($columnName)
175  {
176  $columnName = $this->_transformColumn($columnName);
177  if (!array_key_exists($columnName, $this->_data)) {
178  #require_once 'Zend/Db/Table/Row/Exception.php';
179  throw new Zend_Db_Table_Row_Exception("Specified column \"$columnName\" is not in the row");
180  }
181  return $this->_data[$columnName];
182  }
183 
192  public function __set($columnName, $value)
193  {
194  $columnName = $this->_transformColumn($columnName);
195  if (!array_key_exists($columnName, $this->_data)) {
196  #require_once 'Zend/Db/Table/Row/Exception.php';
197  throw new Zend_Db_Table_Row_Exception("Specified column \"$columnName\" is not in the row");
198  }
199  $this->_data[$columnName] = $value;
200  $this->_modifiedFields[$columnName] = true;
201  }
202 
210  public function __unset($columnName)
211  {
212  $columnName = $this->_transformColumn($columnName);
213  if (!array_key_exists($columnName, $this->_data)) {
214  #require_once 'Zend/Db/Table/Row/Exception.php';
215  throw new Zend_Db_Table_Row_Exception("Specified column \"$columnName\" is not in the row");
216  }
217  if ($this->isConnected() && in_array($columnName, $this->_table->info('primary'))) {
218  #require_once 'Zend/Db/Table/Row/Exception.php';
219  throw new Zend_Db_Table_Row_Exception("Specified column \"$columnName\" is a primary key and should not be unset");
220  }
221  unset($this->_data[$columnName]);
222  return $this;
223  }
224 
231  public function __isset($columnName)
232  {
233  $columnName = $this->_transformColumn($columnName);
234  return array_key_exists($columnName, $this->_data);
235  }
236 
242  public function __sleep()
243  {
244  return array('_tableClass', '_primary', '_data', '_cleanData', '_readOnly' ,'_modifiedFields');
245  }
246 
254  public function __wakeup()
255  {
256  $this->_connected = false;
257  }
258 
266  public function offsetExists($offset)
267  {
268  return $this->__isset($offset);
269  }
270 
278  public function offsetGet($offset)
279  {
280  return $this->__get($offset);
281  }
282 
290  public function offsetSet($offset, $value)
291  {
292  $this->__set($offset, $value);
293  }
294 
301  public function offsetUnset($offset)
302  {
303  return $this->__unset($offset);
304  }
305 
313  public function init()
314  {
315  }
316 
322  public function getTable()
323  {
324  return $this->_table;
325  }
326 
335  public function setTable(Zend_Db_Table_Abstract $table = null)
336  {
337  if ($table == null) {
338  $this->_table = null;
339  $this->_connected = false;
340  return false;
341  }
342 
343  $tableClass = get_class($table);
344  if (! $table instanceof $this->_tableClass) {
345  #require_once 'Zend/Db/Table/Row/Exception.php';
346  throw new Zend_Db_Table_Row_Exception("The specified Table is of class $tableClass, expecting class to be instance of $this->_tableClass");
347  }
348 
349  $this->_table = $table;
350  $this->_tableClass = $tableClass;
351 
352  $info = $this->_table->info();
353 
354  if ($info['cols'] != array_keys($this->_data)) {
355  #require_once 'Zend/Db/Table/Row/Exception.php';
356  throw new Zend_Db_Table_Row_Exception('The specified Table does not have the same columns as the Row');
357  }
358 
359  if (! array_intersect((array) $this->_primary, $info['primary']) == (array) $this->_primary) {
360 
361  #require_once 'Zend/Db/Table/Row/Exception.php';
362  throw new Zend_Db_Table_Row_Exception("The specified Table '$tableClass' does not have the same primary key as the Row");
363  }
364 
365  $this->_connected = true;
366  return true;
367  }
368 
375  public function getTableClass()
376  {
377  return $this->_tableClass;
378  }
379 
385  public function isConnected()
386  {
387  return $this->_connected;
388  }
389 
395  public function isReadOnly()
396  {
397  return $this->_readOnly;
398  }
399 
406  public function setReadOnly($flag)
407  {
408  $this->_readOnly = (bool) $flag;
409  }
410 
416  public function select()
417  {
418  return $this->getTable()->select();
419  }
420 
430  public function save()
431  {
437  if (empty($this->_cleanData)) {
438  return $this->_doInsert();
439  } else {
440  return $this->_doUpdate();
441  }
442  }
443 
448  protected function _doInsert()
449  {
453  if ($this->_readOnly === true) {
454  #require_once 'Zend/Db/Table/Row/Exception.php';
455  throw new Zend_Db_Table_Row_Exception('This row has been marked read-only');
456  }
457 
461  $this->_insert();
462 
466  $data = array_intersect_key($this->_data, $this->_modifiedFields);
467  $primaryKey = $this->_getTable()->insert($data);
468 
473  if (is_array($primaryKey)) {
474  $newPrimaryKey = $primaryKey;
475  } else {
476  //ZF-6167 Use tempPrimaryKey temporary to avoid that zend encoding fails.
477  $tempPrimaryKey = (array) $this->_primary;
478  $newPrimaryKey = array(current($tempPrimaryKey) => $primaryKey);
479  }
480 
487  $this->_data = array_merge($this->_data, $newPrimaryKey);
488 
492  $this->_postInsert();
493 
497  $this->_refresh();
498 
499  return $primaryKey;
500  }
501 
506  protected function _doUpdate()
507  {
511  if ($this->_readOnly === true) {
512  #require_once 'Zend/Db/Table/Row/Exception.php';
513  throw new Zend_Db_Table_Row_Exception('This row has been marked read-only');
514  }
515 
520  $where = $this->_getWhereQuery(false);
521 
525  $this->_update();
526 
531  $diffData = array_intersect_key($this->_data, $this->_modifiedFields);
532 
536  $pkDiffData = array_intersect_key($diffData, array_flip((array)$this->_primary));
537 
542  if (count($pkDiffData) > 0) {
543  $depTables = $this->_getTable()->getDependentTables();
544  if (!empty($depTables)) {
545  $pkNew = $this->_getPrimaryKey(true);
546  $pkOld = $this->_getPrimaryKey(false);
547  foreach ($depTables as $tableClass) {
548  $t = $this->_getTableFromString($tableClass);
549  $t->_cascadeUpdate($this->getTableClass(), $pkOld, $pkNew);
550  }
551  }
552  }
553 
560  if (count($diffData) > 0) {
561  $this->_getTable()->update($diffData, $where);
562  }
563 
569  $this->_postUpdate();
570 
575  $this->_refresh();
576 
582  $primaryKey = $this->_getPrimaryKey(true);
583  if (count($primaryKey) == 1) {
584  return current($primaryKey);
585  }
586 
587  return $primaryKey;
588  }
589 
595  public function delete()
596  {
600  if ($this->_readOnly === true) {
601  #require_once 'Zend/Db/Table/Row/Exception.php';
602  throw new Zend_Db_Table_Row_Exception('This row has been marked read-only');
603  }
604 
605  $where = $this->_getWhereQuery();
606 
610  $this->_delete();
611 
615  $depTables = $this->_getTable()->getDependentTables();
616  if (!empty($depTables)) {
617  $pk = $this->_getPrimaryKey();
618  foreach ($depTables as $tableClass) {
619  $t = $this->_getTableFromString($tableClass);
620  $t->_cascadeDelete($this->getTableClass(), $pk);
621  }
622  }
623 
627  $result = $this->_getTable()->delete($where);
628 
632  $this->_postDelete();
633 
637  $this->_data = array_combine(
638  array_keys($this->_data),
639  array_fill(0, count($this->_data), null)
640  );
641 
642  return $result;
643  }
644 
645  public function getIterator()
646  {
647  return new ArrayIterator((array) $this->_data);
648  }
649 
655  public function toArray()
656  {
657  return (array)$this->_data;
658  }
659 
666  public function setFromArray(array $data)
667  {
668  $data = array_intersect_key($data, $this->_data);
669 
670  foreach ($data as $columnName => $value) {
671  $this->__set($columnName, $value);
672  }
673 
674  return $this;
675  }
676 
682  public function refresh()
683  {
684  return $this->_refresh();
685  }
686 
692  protected function _getTable()
693  {
694  if (!$this->_connected) {
695  #require_once 'Zend/Db/Table/Row/Exception.php';
696  throw new Zend_Db_Table_Row_Exception('Cannot save a Row unless it is connected');
697  }
698  return $this->_table;
699  }
700 
707  protected function _getPrimaryKey($useDirty = true)
708  {
709  if (!is_array($this->_primary)) {
710  #require_once 'Zend/Db/Table/Row/Exception.php';
711  throw new Zend_Db_Table_Row_Exception("The primary key must be set as an array");
712  }
713 
714  $primary = array_flip($this->_primary);
715  if ($useDirty) {
716  $array = array_intersect_key($this->_data, $primary);
717  } else {
718  $array = array_intersect_key($this->_cleanData, $primary);
719  }
720  if (count($primary) != count($array)) {
721  #require_once 'Zend/Db/Table/Row/Exception.php';
722  throw new Zend_Db_Table_Row_Exception("The specified Table '$this->_tableClass' does not have the same primary key as the Row");
723  }
724  return $array;
725  }
726 
733  public function getPrimaryKey($useDirty = true)
734  {
735  return $this->_getPrimaryKey($useDirty);
736  }
737 
744  protected function _getWhereQuery($useDirty = true)
745  {
746  $where = array();
747  $db = $this->_getTable()->getAdapter();
748  $primaryKey = $this->_getPrimaryKey($useDirty);
749  $info = $this->_getTable()->info();
751 
752  // retrieve recently updated row using primary keys
753  $where = array();
754  foreach ($primaryKey as $column => $value) {
755  $tableName = $db->quoteIdentifier($info[Zend_Db_Table_Abstract::NAME], true);
756  $type = $metadata[$column]['DATA_TYPE'];
757  $columnName = $db->quoteIdentifier($column, true);
758  $where[] = $db->quoteInto("{$tableName}.{$columnName} = ?", $value, $type);
759  }
760  return $where;
761  }
762 
768  protected function _refresh()
769  {
770  $where = $this->_getWhereQuery();
771  $row = $this->_getTable()->fetchRow($where);
772 
773  if (null === $row) {
774  #require_once 'Zend/Db/Table/Row/Exception.php';
775  throw new Zend_Db_Table_Row_Exception('Cannot refresh row as parent is missing');
776  }
777 
778  $this->_data = $row->toArray();
779  $this->_cleanData = $this->_data;
780  $this->_modifiedFields = array();
781  }
782 
789  protected function _insert()
790  {
791  }
792 
799  protected function _postInsert()
800  {
801  }
802 
809  protected function _update()
810  {
811  }
812 
819  protected function _postUpdate()
820  {
821  }
822 
829  protected function _delete()
830  {
831  }
832 
839  protected function _postDelete()
840  {
841  }
842 
853  protected function _prepareReference(Zend_Db_Table_Abstract $dependentTable, Zend_Db_Table_Abstract $parentTable, $ruleKey)
854  {
855  $parentTableName = (get_class($parentTable) === 'Zend_Db_Table') ? $parentTable->getDefinitionConfigName() : get_class($parentTable);
856  $map = $dependentTable->getReference($parentTableName, $ruleKey);
857 
859  $parentInfo = $parentTable->info();
860  $map[Zend_Db_Table_Abstract::REF_COLUMNS] = array_values((array) $parentInfo['primary']);
861  }
862 
865 
866  return $map;
867  }
868 
878  public function findDependentRowset($dependentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
879  {
880  $db = $this->_getTable()->getAdapter();
881 
882  if (is_string($dependentTable)) {
883  $dependentTable = $this->_getTableFromString($dependentTable);
884  }
885 
886  if (!$dependentTable instanceof Zend_Db_Table_Abstract) {
887  $type = gettype($dependentTable);
888  if ($type == 'object') {
889  $type = get_class($dependentTable);
890  }
891  #require_once 'Zend/Db/Table/Row/Exception.php';
892  throw new Zend_Db_Table_Row_Exception("Dependent table must be a Zend_Db_Table_Abstract, but it is $type");
893  }
894 
895  // even if we are interacting between a table defined in a class and a
896  // table via extension, ensure to persist the definition
897  if (($tableDefinition = $this->_table->getDefinition()) !== null
898  && ($dependentTable->getDefinition() == null)) {
899  $dependentTable->setOptions(array(Zend_Db_Table_Abstract::DEFINITION => $tableDefinition));
900  }
901 
902  if ($select === null) {
903  $select = $dependentTable->select();
904  } else {
905  $select->setTable($dependentTable);
906  }
907 
908  $map = $this->_prepareReference($dependentTable, $this->_getTable(), $ruleKey);
909 
910  for ($i = 0; $i < count($map[Zend_Db_Table_Abstract::COLUMNS]); ++$i) {
911  $parentColumnName = $db->foldCase($map[Zend_Db_Table_Abstract::REF_COLUMNS][$i]);
912  $value = $this->_data[$parentColumnName];
913  // Use adapter from dependent table to ensure correct query construction
914  $dependentDb = $dependentTable->getAdapter();
915  $dependentColumnName = $dependentDb->foldCase($map[Zend_Db_Table_Abstract::COLUMNS][$i]);
916  $dependentColumn = $dependentDb->quoteIdentifier($dependentColumnName, true);
917  $dependentInfo = $dependentTable->info();
918  $type = $dependentInfo[Zend_Db_Table_Abstract::METADATA][$dependentColumnName]['DATA_TYPE'];
919  $select->where("$dependentColumn = ?", $value, $type);
920  }
921 
922  return $dependentTable->fetchAll($select);
923  }
924 
934  public function findParentRow($parentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
935  {
936  $db = $this->_getTable()->getAdapter();
937 
938  if (is_string($parentTable)) {
939  $parentTable = $this->_getTableFromString($parentTable);
940  }
941 
942  if (!$parentTable instanceof Zend_Db_Table_Abstract) {
943  $type = gettype($parentTable);
944  if ($type == 'object') {
945  $type = get_class($parentTable);
946  }
947  #require_once 'Zend/Db/Table/Row/Exception.php';
948  throw new Zend_Db_Table_Row_Exception("Parent table must be a Zend_Db_Table_Abstract, but it is $type");
949  }
950 
951  // even if we are interacting between a table defined in a class and a
952  // table via extension, ensure to persist the definition
953  if (($tableDefinition = $this->_table->getDefinition()) !== null
954  && ($parentTable->getDefinition() == null)) {
955  $parentTable->setOptions(array(Zend_Db_Table_Abstract::DEFINITION => $tableDefinition));
956  }
957 
958  if ($select === null) {
959  $select = $parentTable->select();
960  } else {
961  $select->setTable($parentTable);
962  }
963 
964  $map = $this->_prepareReference($this->_getTable(), $parentTable, $ruleKey);
965 
966  // iterate the map, creating the proper wheres
967  for ($i = 0; $i < count($map[Zend_Db_Table_Abstract::COLUMNS]); ++$i) {
968  $dependentColumnName = $db->foldCase($map[Zend_Db_Table_Abstract::COLUMNS][$i]);
969  $value = $this->_data[$dependentColumnName];
970  // Use adapter from parent table to ensure correct query construction
971  $parentDb = $parentTable->getAdapter();
972  $parentColumnName = $parentDb->foldCase($map[Zend_Db_Table_Abstract::REF_COLUMNS][$i]);
973  $parentColumn = $parentDb->quoteIdentifier($parentColumnName, true);
974  $parentInfo = $parentTable->info();
975 
976  // determine where part
977  $type = $parentInfo[Zend_Db_Table_Abstract::METADATA][$parentColumnName]['DATA_TYPE'];
978  $nullable = $parentInfo[Zend_Db_Table_Abstract::METADATA][$parentColumnName]['NULLABLE'];
979  if ($value === null && $nullable == true) {
980  $select->where("$parentColumn IS NULL");
981  } elseif ($value === null && $nullable == false) {
982  return null;
983  } else {
984  $select->where("$parentColumn = ?", $value, $type);
985  }
986 
987  }
988 
989  return $parentTable->fetchRow($select);
990  }
991 
1001  public function findManyToManyRowset($matchTable, $intersectionTable, $callerRefRule = null,
1002  $matchRefRule = null, Zend_Db_Table_Select $select = null)
1003  {
1004  $db = $this->_getTable()->getAdapter();
1005 
1006  if (is_string($intersectionTable)) {
1007  $intersectionTable = $this->_getTableFromString($intersectionTable);
1008  }
1009 
1010  if (!$intersectionTable instanceof Zend_Db_Table_Abstract) {
1011  $type = gettype($intersectionTable);
1012  if ($type == 'object') {
1013  $type = get_class($intersectionTable);
1014  }
1015  #require_once 'Zend/Db/Table/Row/Exception.php';
1016  throw new Zend_Db_Table_Row_Exception("Intersection table must be a Zend_Db_Table_Abstract, but it is $type");
1017  }
1018 
1019  // even if we are interacting between a table defined in a class and a
1020  // table via extension, ensure to persist the definition
1021  if (($tableDefinition = $this->_table->getDefinition()) !== null
1022  && ($intersectionTable->getDefinition() == null)) {
1023  $intersectionTable->setOptions(array(Zend_Db_Table_Abstract::DEFINITION => $tableDefinition));
1024  }
1025 
1026  if (is_string($matchTable)) {
1027  $matchTable = $this->_getTableFromString($matchTable);
1028  }
1029 
1030  if (! $matchTable instanceof Zend_Db_Table_Abstract) {
1031  $type = gettype($matchTable);
1032  if ($type == 'object') {
1033  $type = get_class($matchTable);
1034  }
1035  #require_once 'Zend/Db/Table/Row/Exception.php';
1036  throw new Zend_Db_Table_Row_Exception("Match table must be a Zend_Db_Table_Abstract, but it is $type");
1037  }
1038 
1039  // even if we are interacting between a table defined in a class and a
1040  // table via extension, ensure to persist the definition
1041  if (($tableDefinition = $this->_table->getDefinition()) !== null
1042  && ($matchTable->getDefinition() == null)) {
1043  $matchTable->setOptions(array(Zend_Db_Table_Abstract::DEFINITION => $tableDefinition));
1044  }
1045 
1046  if ($select === null) {
1047  $select = $matchTable->select();
1048  } else {
1049  $select->setTable($matchTable);
1050  }
1051 
1052  // Use adapter from intersection table to ensure correct query construction
1053  $interInfo = $intersectionTable->info();
1054  $interDb = $intersectionTable->getAdapter();
1055  $interName = $interInfo['name'];
1056  $interSchema = isset($interInfo['schema']) ? $interInfo['schema'] : null;
1057  $matchInfo = $matchTable->info();
1058  $matchName = $matchInfo['name'];
1059  $matchSchema = isset($matchInfo['schema']) ? $matchInfo['schema'] : null;
1060 
1061  $matchMap = $this->_prepareReference($intersectionTable, $matchTable, $matchRefRule);
1062 
1063  for ($i = 0; $i < count($matchMap[Zend_Db_Table_Abstract::COLUMNS]); ++$i) {
1064  $interCol = $interDb->quoteIdentifier('i' . '.' . $matchMap[Zend_Db_Table_Abstract::COLUMNS][$i], true);
1065  $matchCol = $interDb->quoteIdentifier('m' . '.' . $matchMap[Zend_Db_Table_Abstract::REF_COLUMNS][$i], true);
1066  $joinCond[] = "$interCol = $matchCol";
1067  }
1068  $joinCond = implode(' AND ', $joinCond);
1069 
1070  $select->from(array('i' => $interName), array(), $interSchema)
1071  ->joinInner(array('m' => $matchName), $joinCond, Zend_Db_Select::SQL_WILDCARD, $matchSchema)
1072  ->setIntegrityCheck(false);
1073 
1074  $callerMap = $this->_prepareReference($intersectionTable, $this->_getTable(), $callerRefRule);
1075 
1076  for ($i = 0; $i < count($callerMap[Zend_Db_Table_Abstract::COLUMNS]); ++$i) {
1077  $callerColumnName = $db->foldCase($callerMap[Zend_Db_Table_Abstract::REF_COLUMNS][$i]);
1078  $value = $this->_data[$callerColumnName];
1079  $interColumnName = $interDb->foldCase($callerMap[Zend_Db_Table_Abstract::COLUMNS][$i]);
1080  $interCol = $interDb->quoteIdentifier("i.$interColumnName", true);
1081  $interInfo = $intersectionTable->info();
1082  $type = $interInfo[Zend_Db_Table_Abstract::METADATA][$interColumnName]['DATA_TYPE'];
1083  $select->where($interDb->quoteInto("$interCol = ?", $value, $type));
1084  }
1085 
1086  $stmt = $select->query();
1087 
1088  $config = array(
1089  'table' => $matchTable,
1090  'data' => $stmt->fetchAll(Zend_Db::FETCH_ASSOC),
1091  'rowClass' => $matchTable->getRowClass(),
1092  'readOnly' => false,
1093  'stored' => true
1094  );
1095 
1096  $rowsetClass = $matchTable->getRowsetClass();
1097  if (!class_exists($rowsetClass)) {
1098  try {
1099  #require_once 'Zend/Loader.php';
1100  Zend_Loader::loadClass($rowsetClass);
1101  } catch (Zend_Exception $e) {
1102  #require_once 'Zend/Db/Table/Row/Exception.php';
1103  throw new Zend_Db_Table_Row_Exception($e->getMessage(), $e->getCode(), $e);
1104  }
1105  }
1106  $rowset = new $rowsetClass($config);
1107  return $rowset;
1108  }
1109 
1119  public function __call($method, array $args)
1120  {
1121  $matches = array();
1122 
1123  if (count($args) && $args[0] instanceof Zend_Db_Table_Select) {
1124  $select = $args[0];
1125  } else {
1126  $select = null;
1127  }
1128 
1135  if (preg_match('/^findParent(\w+?)(?:By(\w+))?$/', $method, $matches)) {
1136  $class = $matches[1];
1137  $ruleKey1 = isset($matches[2]) ? $matches[2] : null;
1138  return $this->findParentRow($class, $ruleKey1, $select);
1139  }
1140 
1148  if (preg_match('/^find(\w+?)Via(\w+?)(?:By(\w+?)(?:And(\w+))?)?$/', $method, $matches)) {
1149  $class = $matches[1];
1150  $viaClass = $matches[2];
1151  $ruleKey1 = isset($matches[3]) ? $matches[3] : null;
1152  $ruleKey2 = isset($matches[4]) ? $matches[4] : null;
1153  return $this->findManyToManyRowset($class, $viaClass, $ruleKey1, $ruleKey2, $select);
1154  }
1155 
1162  if (preg_match('/^find(\w+?)(?:By(\w+))?$/', $method, $matches)) {
1163  $class = $matches[1];
1164  $ruleKey1 = isset($matches[2]) ? $matches[2] : null;
1165  return $this->findDependentRowset($class, $ruleKey1, $select);
1166  }
1167 
1168  #require_once 'Zend/Db/Table/Row/Exception.php';
1169  throw new Zend_Db_Table_Row_Exception("Unrecognized method '$method()'");
1170  }
1171 
1172 
1179  protected function _getTableFromString($tableName)
1180  {
1182  }
1183 
1184 }
_prepareReference(Zend_Db_Table_Abstract $dependentTable, Zend_Db_Table_Abstract $parentTable, $ruleKey)
Definition: Abstract.php:853
getReference($tableClassname, $ruleKey=null)
Definition: Abstract.php:461
$tableName
Definition: trigger.php:13
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
static loadClass($class, $dirs=null)
Definition: Loader.php:52
$config
Definition: fraud_order.php:17
getPrimaryKey($useDirty=true)
Definition: Abstract.php:733
const FETCH_ASSOC
Definition: Db.php:142
_getPrimaryKey($useDirty=true)
Definition: Abstract.php:707
findDependentRowset($dependentTable, $ruleKey=null, Zend_Db_Table_Select $select=null)
Definition: Abstract.php:878
findParentRow($parentTable, $ruleKey=null, Zend_Db_Table_Select $select=null)
Definition: Abstract.php:934
const SQL_WILDCARD
Definition: Select.php:66
$type
Definition: item.phtml:13
_transformColumn($columnName)
Definition: Abstract.php:157
$_option $_optionId $class
Definition: date.phtml:13
$value
Definition: gender.phtml:16
setTable(Zend_Db_Table_Abstract $table=null)
Definition: Abstract.php:335
$method
Definition: info.phtml:13
_getWhereQuery($useDirty=true)
Definition: Abstract.php:744
findManyToManyRowset($matchTable, $intersectionTable, $callerRefRule=null, $matchRefRule=null, Zend_Db_Table_Select $select=null)
Definition: Abstract.php:1001
setFromArray(array $data)
Definition: Abstract.php:666
__construct(array $config=array())
Definition: Abstract.php:114
foreach( $_productCollection as $_product)() ?>" class $info
Definition: listing.phtml:52
$table
Definition: trigger.php:14
__call($method, array $args)
Definition: Abstract.php:1119
_getTableFromString($tableName)
Definition: Abstract.php:1179
$i
Definition: gallery.phtml:31
__set($columnName, $value)
Definition: Abstract.php:192
static getTableFromString($tableName, Zend_Db_Table_Abstract $referenceTable=null)
Definition: Abstract.php:1606
offsetSet($offset, $value)
Definition: Abstract.php:290