| 1 | <?php |
||
| 21 | abstract class AdminPageFramework_Factory_Model extends AdminPageFramework_Factory_Router { |
||
|
1 ignored issue
–
show
|
|||
| 22 | |||
| 23 | /** |
||
| 24 | * Sets up hooks and properties. |
||
| 25 | * |
||
| 26 | * @since DEVVER |
||
| 27 | * @internal |
||
| 28 | */ |
||
| 29 | public function __construct( $oProp ) { |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Calls the setUp() method. |
||
| 42 | * |
||
| 43 | * @since 3.1.0 |
||
| 44 | * @todo Deprecate this method. This method was intended to be used in a user defined abstract class |
||
| 45 | * but it requires to call the setUp() method in the overridden method so it's not that useful. |
||
| 46 | * @internal |
||
| 47 | */ |
||
| 48 | protected function _setUp() { |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Called upon fieldset resource registration. |
||
| 54 | * |
||
| 55 | * A contextual help pane item associated with this fieldset will be added. |
||
| 56 | * |
||
| 57 | * @since DEVVER |
||
| 58 | * @return void |
||
| 59 | */ |
||
| 60 | public function _replyToFieldsetReourceRegistration( $aFieldset ) { |
||
| 77 | |||
| 78 | /** |
||
| 79 | * Filters field type definitions array. |
||
| 80 | * @callback filter field_types_admin_page_framework |
||
| 81 | * @since DEVVER |
||
| 82 | */ |
||
| 83 | public function _replyToFilterFieldTypeDefinitions( $aFieldTypeDefinitions ) { |
||
| 90 | |||
| 91 | /** |
||
| 92 | * Modifies registered sectionsets definition array. |
||
| 93 | * |
||
| 94 | * This lets third party scripts to set their own sections |
||
| 95 | * before the framework registered field resource (assets) files. |
||
| 96 | * |
||
| 97 | * @remark Called prior to field resource registrations. |
||
| 98 | * @since DEVVER |
||
| 99 | * @return array The modified sectionsets definition array. |
||
| 100 | */ |
||
| 101 | public function _replyToModifySectionsets( $aSectionsets ) { |
||
| 110 | |||
| 111 | /** |
||
| 112 | * Modifies registered fieldsets definition array. |
||
| 113 | * |
||
| 114 | * This lets third party scripts to set their own sections |
||
| 115 | * before the framework registered field resource (assets) files. |
||
| 116 | * |
||
| 117 | * @remark Called prior to field resource registrations. |
||
| 118 | * @since DEVVER |
||
| 119 | * @return array The modified fieldsets definition array. |
||
| 120 | */ |
||
| 121 | public function _replyToModifyFieldsets( $aFieldsets, $aSectionsets ) { |
||
| 148 | |||
| 149 | /** |
||
| 150 | * Applies filters to all the conditioned field definitions array. |
||
| 151 | * @since DEVVER |
||
| 152 | * @return array |
||
| 153 | */ |
||
| 154 | public function _replyToModifyFieldsetsDefinitions( $aFieldsets /*, $aSectionsets */ ) { |
||
| 161 | |||
| 162 | /** |
||
| 163 | * Applies filters to each conditioned (formatted) field definition array. |
||
| 164 | * |
||
| 165 | * @since 3.0.2 |
||
| 166 | * @since 3.1.1 Made it reformat the fields after applying filters. |
||
| 167 | * @since DEVVER Changed the name from `applyFiltersToFieldsets()`. |
||
| 168 | * Moved from `AdminPageFramework_FormDefinition_Base`. |
||
| 169 | * @return array |
||
| 170 | */ |
||
| 171 | public function _replyToModifyFieldsetDefinition( $aFieldset /*, $aSectionsets */ ) { |
||
| 188 | |||
| 189 | /** |
||
| 190 | * Gets called after the form element registration is done. |
||
| 191 | * |
||
| 192 | * @since DEVVER |
||
| 193 | */ |
||
| 194 | public function _replyToHandleSubmittedFormData( $aSavedData, $aArguments, $aSectionsets, $aFieldsets ) { |
||
| 197 | |||
| 198 | /** |
||
| 199 | * @since DEVVER |
||
| 200 | * @return array |
||
| 201 | */ |
||
| 202 | public function _replyToFormatFieldsetDefinition( $aFieldset, $aSectionsets ) { |
||
| 210 | |||
| 211 | /** |
||
| 212 | * @since DEVVER |
||
| 213 | * @return array |
||
| 214 | */ |
||
| 215 | public function _replyToFormatSectionsetDefinition( $aSectionset ) { |
||
| 230 | |||
| 231 | /** |
||
| 232 | * @since DEVVER |
||
| 233 | * @return boolean Whether or not the form registration should be allowed in the current screen. |
||
| 234 | */ |
||
| 235 | public function _replyToDetermineWhetherToProcessFormRegistration( $bAllowed ) { |
||
| 238 | |||
| 239 | /** |
||
| 240 | * Returns the inherited capability value from the page and in-page tab for form elements. |
||
| 241 | * |
||
| 242 | * @since DEVVER Moved from `AdminPageFramework_FormDefinition_Page`. |
||
| 243 | * @return string |
||
| 244 | */ |
||
| 245 | public function _replyToGetCapabilityForForm( $sCapability ) { |
||
| 248 | |||
| 249 | /** |
||
| 250 | * Called when the form object tries to set the form data from the database. |
||
| 251 | * |
||
| 252 | * @callback form `saved_data` |
||
| 253 | * @remark The `oOptions` property will be automatically set with the overload method. |
||
| 254 | * @return array The saved form data. |
||
| 255 | * @since DEVVER |
||
| 256 | */ |
||
| 257 | public function _replyToGetSavedFormData() { |
||
| 264 | |||
| 265 | /** |
||
| 266 | * Returns the saved options array. |
||
| 267 | * |
||
| 268 | * The scope public it is accessed from the outside. This is mainly for field callback methods to create inner nested or different type of fields |
||
| 269 | * as instantiating a field object requires this value. |
||
| 270 | * |
||
| 271 | * This method is used from inside field classes especially for the 'revealer' custom field type that needs to create a field object |
||
| 272 | * while processing the revealer field output. For that, the saved option array needs to be passed and accessing the property object was somewhat indirect |
||
| 273 | * so there needs to be a direct method to retrieve the options. |
||
| 274 | * |
||
| 275 | * As of DEVVER, the form object will store the saved options by itself. And the revealer field type shuold use the form object method. |
||
| 276 | * |
||
| 277 | * @remark When the confirmation URL query key is set, it will merger the saved options with the last form input array, used for contact forms. |
||
| 278 | * @since 3.3.0 |
||
| 279 | * @since 3.3.1 Moved from `AdminPageFramework_Setting_Base`. Changed the visibility scope to `protected` as the caller method has moved to the view class. |
||
| 280 | * @since 3.4.0 Changed the visibility scope to public. |
||
| 281 | * @since 3.4.1 Changed the name from '_getSavedOptions()'. |
||
| 282 | * @since DEVVER Moved from `AdminPageFramework_Model_Form`. |
||
| 283 | * @remark assumes the `aSavedData` property is already set. |
||
| 284 | * This is set when the form fields are registered. |
||
| 285 | * @deprecated DEVVER Kept for backward compatibility. |
||
| 286 | */ |
||
| 287 | public function getSavedOptions() { |
||
| 290 | |||
| 291 | /** |
||
| 292 | * Returns the settings error array set by the user in the validation callback. |
||
| 293 | * |
||
| 294 | * The scope is public because it is accessed from outside ofo the class. This is mainly for field callback methods to create inner nested or different type of fields |
||
| 295 | * as instantiating a field object requires this value. |
||
| 296 | * |
||
| 297 | * @since 3.4.0 |
||
| 298 | */ |
||
| 299 | public function getFieldErrors() { |
||
| 302 | |||
| 303 | /** |
||
| 304 | * Retrieves the settings error array set by the user in the validation callback. |
||
| 305 | * |
||
| 306 | * @since 3.0.4 |
||
| 307 | * @since 3.6.3 Changed the visibility scope to public as a delegation class needs to access this method. |
||
| 308 | * @since DEVVER Changed back the visibility scope to protected as there is the `getFieldErrors()` public method. |
||
| 309 | * @access protected |
||
| 310 | * @internal |
||
| 311 | * @param string $sID deprecated |
||
| 312 | * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
||
| 313 | * @return array |
||
| 314 | * @deprecated DEVVER Use `getFieldErrors()` instead. Kept for backward compatibility. |
||
| 315 | */ |
||
| 316 | protected function _getFieldErrors( /* $sID='deprecated', $bDelete=true */ ) { |
||
| 319 | |||
| 320 | /** |
||
| 321 | * Saves user last input in the database as a transient. |
||
| 322 | * |
||
| 323 | * To get the set input, call `$this->oProp->aLastInput`. |
||
| 324 | * |
||
| 325 | * @since 3.4.1 |
||
| 326 | * @since DEVVER Changed the name from `_setLastInput()`. |
||
| 327 | * @return boolean True if set; otherwise, false. |
||
| 328 | * @internal |
||
| 329 | */ |
||
| 330 | public function setLastInputs( array $aLastInputs ) { |
||
| 333 | /** |
||
| 334 | * An alias of `_setLastInputs()`. |
||
| 335 | * @deprecated DEVVER |
||
| 336 | */ |
||
| 337 | public function _setLastInput( $aLastInputs ) { |
||
| 340 | |||
| 341 | |||
| 342 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.