Overview

Namespaces

  • DcGeneral
    • Clipboard
    • Contao
      • Callback
      • Compatibility
      • DataDefinition
        • Definition
      • Dca
        • Builder
          • Legacy
        • Definition
        • Palette
        • Populator
      • Event
      • View
        • Contao2BackendView
          • Event
    • Controller
    • Data
    • DataDefinition
      • Builder
      • Definition
        • Properties
        • View
          • Panel
      • ModelRelationship
      • Palette
        • Builder
          • Event
        • Condition
          • Palette
          • Property
    • EnvironmentPopulator
    • Event
    • Exception
    • Factory
      • Event
    • Panel
    • View
      • Event

Classes

  • AbstractModel
  • DCGE
  • DefaultCollection
  • DefaultConfig
  • DefaultDataProvider
  • DefaultLanguageInformation
  • DefaultLanguageInformationCollection
  • DefaultModel
  • MultiLanguageDataProvider
  • NoOpDataProvider
  • PropertyValueBag
  • TableRowsAsRecordsDataProvider

Interfaces

  • CollectionInterface
  • ConfigInterface
  • DataProviderInterface
  • LanguageInformationCollectionInterface
  • LanguageInformationInterface
  • ModelInterface
  • MultiLanguageDataProviderInterface
  • PropertyValueBagInterface
  • VersionModelInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * PHP version 5
  4:  * @package    generalDriver
  5:  * @author     Christian Schiffler <c.schiffler@cyberspectrum.de>
  6:  * @author     Stefan Heimes <stefan_heimes@hotmail.com>
  7:  * @author     Tristan Lins <tristan.lins@bit3.de>
  8:  * @copyright  The MetaModels team.
  9:  * @license    LGPL.
 10:  * @filesource
 11:  */
 12: 
 13: namespace DcGeneral\Data;
 14: 
 15: /**
 16:  * Class NoOpDataProvider.
 17:  *
 18:  * Base implementation of an no operational data provider. This data provider is simply a stub endpoint without any
 19:  * logic at all. It is useful as parent class for drivers that only implement a fraction of all DcGeneral features.
 20:  *
 21:  * @package DcGeneral\Data
 22:  */
 23: class NoOpDataProvider implements DataProviderInterface
 24: {
 25:     /**
 26:      * The configuration data for this instance.
 27:      *
 28:      * @var array
 29:      */
 30:     protected $arrBaseConfig;
 31: 
 32:     /**
 33:      * {@inheritdoc}
 34:      */
 35:     public function setBaseConfig(array $arrConfig)
 36:     {
 37:         $this->arrBaseConfig = $arrConfig;
 38:     }
 39: 
 40:     /**
 41:      * {@inheritdoc}
 42:      */
 43:     public function getEmptyConfig()
 44:     {
 45:         return DefaultConfig::init();
 46:     }
 47: 
 48:     /**
 49:      * {@inheritdoc}
 50:      */
 51:     public function getEmptyModel()
 52:     {
 53:         return new DefaultModel();
 54:     }
 55: 
 56:     /**
 57:      * {@inheritdoc}
 58:      */
 59:     public function getEmptyCollection()
 60:     {
 61:         return new DefaultCollection();
 62:     }
 63: 
 64:     /**
 65:      * {@inheritdoc}
 66:      */
 67:     public function fetch(ConfigInterface $objConfig)
 68:     {
 69:         return new DefaultModel();
 70:     }
 71: 
 72:     /**
 73:      * {@inheritdoc}
 74:      */
 75:     public function fetchAll(ConfigInterface $objConfig)
 76:     {
 77:         return new DefaultCollection();
 78:     }
 79: 
 80:     /**
 81:      * {@inheritdoc}
 82:      */
 83:     public function getFilterOptions(ConfigInterface $objConfig)
 84:     {
 85:         return new DefaultCollection();
 86:     }
 87: 
 88:     /**
 89:      * {@inheritdoc}
 90:      */
 91:     public function getCount(ConfigInterface $objConfig)
 92:     {
 93:         return 0;
 94:     }
 95: 
 96:     /**
 97:      * {@inheritdoc}
 98:      */
 99:     public function save(ModelInterface $objItem)
100:     {
101:     }
102: 
103:     /**
104:      * {@inheritdoc}
105:      */
106:     public function saveEach(CollectionInterface $objItems)
107:     {
108:         foreach ($objItems as $objItem)
109:         {
110:             $this->save($objItem);
111:         }
112:     }
113: 
114:     /**
115:      * {@inheritdoc}
116:      */
117:     public function delete($item)
118:     {
119:     }
120: 
121:     /**
122:      * {@inheritdoc}
123:      */
124:     public function saveVersion(ModelInterface $objModel, $strUsername)
125:     {
126:     }
127: 
128:     /**
129:      * {@inheritdoc}
130:      */
131:     public function getVersion($mixID, $mixVersion)
132:     {
133:         return null;
134:     }
135: 
136:     /**
137:      * {@inheritdoc}
138:      */
139:     public function getVersions($mixID, $blnOnlyActive = false)
140:     {
141:         return null;
142:     }
143: 
144:     /**
145:      * {@inheritdoc}
146:      */
147:     public function setVersionActive($mixID, $mixVersion)
148:     {
149:     }
150: 
151:     /**
152:      * {@inheritdoc}
153:      */
154:     public function getActiveVersion($mixID)
155:     {
156:         return null;
157:     }
158: 
159:     /**
160:      * {@inheritdoc}
161:      */
162:     public function resetFallback($strField)
163:     {
164:     }
165: 
166:     /**
167:      * {@inheritdoc}
168:      */
169:     public function isUniqueValue($strField, $varNew, $intId = null)
170:     {
171:         return true;
172:     }
173: 
174:     /**
175:      * {@inheritdoc}
176:      */
177:     public function fieldExists($strField)
178:     {
179:         return false;
180:     }
181: 
182:     /**
183:      * {@inheritdoc}
184:      */
185:     public function sameModels($objModel1 , $objModel2)
186:     {
187:         $arrProperties1 = $objModel1->getPropertiesAsArray();
188:         $arrProperties2 = $objModel2->getPropertiesAsArray();
189: 
190:         $arrKeys = array_merge(array_keys($arrProperties1), array_keys($arrProperties2));
191:         $arrKeys = array_unique($arrKeys);
192:         foreach ($arrKeys as $strKey)
193:         {
194:             if (!array_key_exists($strKey, $arrProperties1) ||
195:                 !array_key_exists($strKey, $arrProperties2) ||
196:                 $arrProperties1[$strKey] != $arrProperties2[$strKey]
197:             )
198:             {
199:                 return false;
200:             }
201:         }
202: 
203:         return true;
204:     }
205: }
206: 
contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0