Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
ValidatorsManagerInitTrait.php
Go to the documentation of this file.
1<?php
2
4
8
15
23 public static function initModelsValidators(&$config, $databaseOffset = 'default') {
24 $models = CacheManager::getModels ( $config, true, $databaseOffset );
25 foreach ( $models as $model ) {
27 }
28 }
29
37 public static function initClassValidators($class) {
38 $parser = new ValidationModelParser();
39 $parser->parse ( $class );
40 $validators = $parser->getValidators ();
41 if (\count ( $validators ) > 0) {
42 self::store ( $class, $validators );
43 }
44 }
45
51 public static function addClassValidators($class) {
52 $config = Startup::getConfig ();
53 CacheManager::start ( $config );
55 }
56
63 public static function registerType($type, $validatorClass) {
64 self::$validatorTypes [$type] = $validatorClass;
65 }
66}
67
Manager for caches (Router, Rest, models).
static initModelsValidators(&$config, $databaseOffset='default')
Parses models and save validators in cache to use in dev only.
static initClassValidators($class)
Parses a class and save validators in cache to use in dev only.
static registerType($type, $validatorClass)
Registers a validator type for using with @validator annotation.
static addClassValidators($class)
Parses a class and save validators in cache.
Starts the framework.
Definition Startup.php:19