Example #1
0
 /**
  * The validation rules for this model
  *
  * @return void
  * @author Dan Cox
  */
 public static function rules(ClassMetaData $metadata)
 {
     $metadata->addPropertyConstraint('label', new Assert\NotBlank(['message' => 'The Exclusion name is required']));
     $metadata->addPropertyConstraint('label', new Assert\Length(['min' => 2, 'max' => 255, 'minMessage' => 'The Exclusion name must be atleast {{ limit }} characters long', 'maxMessage' => 'The Exclusion name must be no more than {{ limit }} characters long']));
     $metadata->addPropertyConstraint('day', new Assert\NotBlank(['message' => 'You must select a day for the exclusion']));
     $metadata->addPropertyConstraint('times', new Assert\NotBlank(['message' => 'Please specify the times for this exclusion']));
 }
Example #2
0
 /**
  * Validation Rules
  *
  * @return void
  * @author Dan Cox
  */
 public static function rules(ClassMetaData $metadata)
 {
     $metadata->addPropertyConstraint('name', new Assert\NotBlank(['message' => 'The Name field is required']));
     $metadata->addPropertyConstraint('name', new Assert\Length(['min' => 2, 'max' => 255, 'minMessage' => 'The name field must be atleast {{ limit }} characters long', 'maxMessage' => 'The name field must be no more than {{ limit }} characters long']));
 }
Example #3
0
 public static function getClassDefs(PHC $phc)
 {
     $children = $phc->getXmlElement()->children(PHC::PHC_NS);
     $list = new ClassMetaDataList();
     foreach ($children->AST_class_def_list as $key => $classDefList) {
         if (strcasecmp($key, ClassMetaDataList::NODE_NAME) !== 0) {
             continue;
         }
         $children = $classDefList->children();
         foreach ($children as $name => $classDef) {
             if (strcasecmp($name, ClassMetaData::NODE_NAME) !== 0) {
                 continue;
             }
             $classMeta = new ClassMetaData();
             $classMeta->setToken(new ClassTokenMetaData(self::getTokenValue($classDef->Token_class_name)));
             $classMeta->setInterfaceMetaDataList(self::getInterfaceNameList($classDef));
             $classMeta->setMemberList(self::getMemberList($classDef));
             $list->add($classMeta);
         }
     }
     return $list;
 }
Example #4
0
 /**
  * The validation rules for this model.
  *
  * @return void
  * @author Dan Cox
  */
 public static function rules(ClassMetaData $metadata)
 {
     $metadata->addPropertyConstraint('label', new Assert\NotBlank(['message' => 'The Activity name is required']));
     $metadata->addPropertyConstraint('label', new Assert\Length(['min' => 2, 'max' => 255, 'minMessage' => 'The Activity name must be atleast {{ limit }} characters long', 'maxMessage' => 'The Activity name must be no more than {{ limit }} characters long']));
     $metadata->addGetterConstraint('optionSelected', new Assert\True(['message' => 'You must set either hours or explicit day/time option']));
 }
 /**
  * @param ClassMetadata $metadata
  */
 private function recordVisit(ClassMetaData $metadata)
 {
     $this->enabledItems[$metadata->getName()] = true;
 }
Example #6
0
 public function visitClassMeta(ClassMetaData $meta)
 {
     $buf = new TreeOutput();
     $buf->add('[' . $meta->getNodeName() . ']');
     $buf->down();
     $buf->writeln($meta->getToken()->toJSValue($this));
     $buf->writeln($meta->getInterfaceList()->toJSValue($this));
     $buf->writeln($meta->getMemberList()->toJSValue($this));
     $buf->up();
     return $buf;
 }