2 // vim: foldmethod=marker
4 * Ethna_Plugin_Handle_AddAppObject.php
6 * @author Masaki Fujimoto <fujimoto@php.net>
7 * @license http://www.opensource.org/licenses/bsd-license.php The BSD License
12 // {{{ Ethna_Plugin_Handle_AddAppObject
14 * add-app-object handler
16 * @author Masaki Fujimoto <fujimoto@php.net>
20 class Ethna_Plugin_Handle_AddAppObject extends Ethna_Plugin_Handle
29 return $this->_perform('AppObject');
35 function _perform($target)
37 $r =& $this->_getopt(array('basedir='));
38 if (Ethna::isError($r)) {
41 list($opt_list, $arg_list) = $r;
44 $table_name = array_shift($arg_list);
45 if ($table_name == null) {
46 return Ethna::raiseError('table name isn\'t set.', 'usage');
50 if (isset($opt_list['basedir'])) {
51 $basedir = realpath(end($opt_list['basedir']));
56 $r =& Ethna_Generator::generate($target, $basedir, $table_name);
57 if (Ethna::isError($r)) {
58 printf("error occurred while generating skelton. please see also following error message(s)\n\n");
66 * get handler's description
70 function getDescription()
73 add new app-object to project:
74 {$this->id} [-b|--basedir=dir] [table name]
87 ethna {$this->id} [-b|--basedir=dir] [table name]