LeanMapper\Reflection\Property::hasCustomFlag PHP Метод

hasCustomFlag() публичный Метод

Tells whether property has custom flag
public hasCustomFlag ( string $name ) : boolean
$name string
Результат boolean
    public function hasCustomFlag($name)
    {
        return array_key_exists($name, $this->customFlags);
    }

Usage 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;
 }
All Usage Examples Of LeanMapper\Reflection\Property::hasCustomFlag