Esempio n. 1
0
 public function __construct($args)
 {
     parent::__construct(Types_Field_Type_Definition_Factory::NUMERIC, $args);
 }
Esempio n. 2
0
 /**
  * @param Types_Field_Type_Definition $from_type
  * @param Types_Field_Type_Definition $to_type
  *
  * @return bool
  */
 public function is_conversion_possible($from_type, $to_type)
 {
     if (!$from_type instanceof Types_Field_Type_Definition || !$to_type instanceof Types_Field_Type_Definition) {
         throw new InvalidArgumentException('Not a field type definition');
     }
     $possible_conversions = $this->get_possible_conversions($from_type);
     return in_array($to_type->get_slug(), array_keys($possible_conversions));
 }