hasCustomFlag() public method

Tells whether property has custom flag
public hasCustomFlag ( string $name ) : boolean
$name string
return boolean
Example #1
0
 private function getType(Property $property)
 {
     $type = NULL;
     if ($property->isBasicType()) {
         $type = $property->getType();
         if ($type == 'string') {
             if (!$property->hasCustomFlag('size')) {
                 $type = 'text';
             }
         }
         /* if ($property->containsEnumeration()) {
         	  $type = 'enum';
         	  } */
     } else {
         // Objects
         $class = new ReflectionClass($property->getType());
         $class = $class->newInstance();
         if ($class instanceof DateTime) {
             if ($property->hasCustomFlag('format')) {
                 $type = $property->getCustomFlagValue('format');
             } else {
                 $type = 'datetime';
             }
         }
     }
     return $type;
 }
Example #2
0
 private function replacePlaceholder(Property $property)
 {
     $type = $property->getType();
     if ($property->isBasicType()) {
         if (array_key_exists($type, self::$placeholders)) {
             return self::$placeholders[$type];
         } else {
             return self::$defaultPlaceholder;
         }
     } else {
         if ($type === 'DateTime' || is_subclass_of($type, 'DateTime')) {
             if ($property->hasCustomFlag(self::$typeFlagName) && preg_match('#^(DATE|Date|date)$#', $property->getCustomFlagValue(self::$typeFlagName))) {
                 return self::$placeholders['Date'];
             } else {
                 return self::$placeholders['DateTime'];
             }
         } else {
             return self::$defaultPlaceholder;
         }
     }
 }
 private function isIgnored(Property $property)
 {
     return $property->hasCustomFlag('baked') || $property->hasCustomFlag('ignore') || $property->hasCustomFlag('ignored');
 }