Exemple #1
0
 public function validate()
 {
     $vMessage = array();
     foreach ($this->requiredProperties as $name) {
         if (is_null($this->{$name})) {
             $vMessage[] = Message::translateMessage('og.required_property', $this->Type, $name);
         }
     }
     if (count($vMessage) > 0) {
         return $vMessage;
     } else {
         return true;
     }
 }
Exemple #2
0
<?php

use Doctrine\Common\Annotations\AnnotationRegistry;
use dayax\core\ExceptionFactory;
use dayax\core\Message;
use dayax\core\Translator;
$loader = (require __DIR__ . '/../vendor/autoload.php');
// intl
if (!function_exists('intl_get_error_code')) {
    require_once __DIR__ . '/../vendor/symfony/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
}
AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
ExceptionFactory::addPackage('SIP');
ExceptionFactory::register();
Message::addCatalog('SIP', __DIR__ . '/../vendor/perijinan/core/SIP/Core/Resources/messages');
//Message::addCatalog('SIP',__DIR__.'/../vendor/perijinan/admin/SIP/Admin/Resources/messages');
$cacheDir = __DIR__ . '/cache/dayax/messages';
if (!is_dir($cacheDir)) {
    mkdir($cacheDir, 0777, TRUE);
}
Translator::getInstance()->setCacheDir($cacheDir);
//Message::addCatalog('SIP\\Admin',__DIR__.'/src/SIP/Admin/Resources/messages');
return $loader;