Make::a PHP Method

a() static public method

static public a ( $class )
    static function a($class)
    {
        $args = func_get_args();
        return self::makeByArray($args);
    }

Usage Example

 public static function validate($object, $fields, $message)
 {
     foreach ($fields as $fieldName) {
         if (isset($object->{$fieldName})) {
             $objClass = get_class($object);
             $objQuery = Make::a($objClass)->equal($fieldName, $object->{$fieldName});
             $objIsNotUnique = isset($object->id) ? $objQuery->notEqual('id', $object->id)->exists() : $objQuery->exists();
             if ($objIsNotUnique) {
                 $object->errors[] = self::labelForObjectProperty($object, $fieldName) . ' ' . $message;
             }
         }
     }
 }
All Usage Examples Of Make::a