Add todo about model validation

This commit is contained in:
Toby Zerner 2015-07-01 13:35:27 +09:30
parent eafdd415ef
commit c1595af84f
2 changed files with 10 additions and 3 deletions

View File

@ -14,6 +14,12 @@ use LogicException;
* Adds the ability for custom relations to be added to a model during runtime. * Adds the ability for custom relations to be added to a model during runtime.
* These relations behave in the same way that you would expect; they can be * These relations behave in the same way that you would expect; they can be
* queried, eager loaded, and accessed as an attribute. * queried, eager loaded, and accessed as an attribute.
*
* @todo Refactor out validation, either into a trait or into a dependency.
* The following requirements need to be fulfilled:
* - Ability for extensions to alter ruleset.
* - Ability for extensions to add custom rules to the validator instance.
* - Use Flarum's translator with the validator instance.
*/ */
abstract class Model extends Eloquent abstract class Model extends Eloquent
{ {

View File

@ -2,6 +2,9 @@
use Closure; use Closure;
/**
* @todo implement Symfony\Component\Translation\TranslatorInterface
*/
class Translator class Translator
{ {
protected $translations; protected $translations;
@ -16,9 +19,7 @@ class Translator
public function plural($count) public function plural($count)
{ {
$callback = $this->plural; return {$this->plural}($count);
return $callback($count);
} }
public function translate($key, array $input = []) public function translate($key, array $input = [])