Model.php 699 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * Lithium: the most rad php framework
  4. *
  5. * @copyright Copyright 2012, Union of RAD (http://union-of-rad.org)
  6. * @license http://opensource.org/licenses/bsd-license.php The BSD License
  7. */
  8. namespace lithium\console\command\create;
  9. use lithium\util\Inflector;
  10. /**
  11. * Generate a Model class in the `--library` namespace
  12. *
  13. * `li3 create model Posts`
  14. * `li3 create --library=li3_plugin model Posts`
  15. *
  16. */
  17. class Model extends \lithium\console\command\Create {
  18. /**
  19. * Get the class name for the model.
  20. *
  21. * @param string $request
  22. * @return string
  23. */
  24. protected function _class($request) {
  25. return Inflector::camelize(Inflector::pluralize($request->action));
  26. }
  27. }
  28. ?>