Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SetupCache.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
20  private $data = [];
21 
25  public function setRow($table, $parentId, $rowId, $value)
26  {
27  $this->data[$table][$parentId][$rowId] = $value;
28  }
29 
33  public function setField($table, $parentId, $rowId, $field, $value)
34  {
35  $this->data[$table][$parentId][$rowId][$field] = $value;
36  }
37 
41  public function get($table, $parentId, $rowId, $field = null)
42  {
43  if (null === $field) {
44  return $this->data[$table][$parentId][$rowId] ?? false;
45  } else {
46  return $this->data[$table][$parentId][$rowId][$field] ?? false;
47  }
48  }
49 
53  public function remove($table, $parentId, $rowId)
54  {
55  if (isset($this->data[$table][$parentId][$rowId])) {
56  unset($this->data[$table][$parentId][$rowId]);
57  }
58  }
59 
63  public function has($table, $parentId, $rowId, $field = null)
64  {
65  if (null === $field) {
66  return !empty($this->data[$table][$parentId][$rowId]);
67  } else {
68  return !empty($this->data[$table][$parentId][$rowId][$field]);
69  }
70  }
71 }
has($table, $parentId, $rowId, $field=null)
Definition: SetupCache.php:63
setField($table, $parentId, $rowId, $field, $value)
Definition: SetupCache.php:33
$value
Definition: gender.phtml:16
setRow($table, $parentId, $rowId, $value)
Definition: SetupCache.php:25
$table
Definition: trigger.php:14