Add Admin Commands for an entity.
962725
public function addAdministrationCommands()
    {
        $entity = $this->getController()->getItem();

        if ($entity->isOwnable() && $entity->owner->authorize('administration')) {
            if ($entity->isEnablable()) {
                $this->addCommand('enable');
            }

            if ($entity->isCommentable()) {
                $this->addCommand('commentstatus');
            }
        }
    }
413093
def add_command(self, cmd_name, *args):
        """"""
        self.__commands.append(Command(cmd_name, args))
382301
def generate_entities_doc(ctx, out_path, package):
    """"""
    from canari.commands.generate_entities_doc import generate_entities_doc
    generate_entities_doc(ctx.project, out_path, package)
1144442
private function registerArtisanCommands() {
        $this->commands([
            \BackupManager\Laravel\Laravel5DbBackupCommand::class,
            \BackupManager\Laravel\Laravel5DbRestoreCommand::class,
            \BackupManager\Laravel\Laravel5DbListCommand::class,
        ]);
    }
487648
def add(self, command, *args):
        

        cmd = Command(command, args)
        self.commands.append(cmd)
59345
def cmd(send, _, args):
    
    adminlist = []
    for admin in args['db'].query(Permissions).order_by(Permissions.nick).all():
        if admin.registered:
            adminlist.append("%s (V)" % admin.nick)
        else:
            adminlist.append("%s (U)" % admin.nick)
    send(", ".join(adminlist), target=args['nick'])
78186
def add_data(self, request, pk=None):
        """"""
        # add data to entity
        resp = super().add_data(request, pk)

        # add data to collections in which entity is
        entity = self.get_object()
        for collection in entity.collections.all():
            collection.data.add(*request.data['ids'])

        return resp
1275974
protected function registerCommands()
    {
        if ($this->app->runningInConsole()) {
            $this->commands([
                ModulesCommand::class,
                ModelsCommand::class,
                EnumsCommand::class,
                RequestsCommand::class,
                MakeModuleCommand::class,
                VersionCommand::class
            ]);
        }
    }
165922
protected function registerSelfUpdateCommand()
    {
        $this->getContainer()->add(SelfUpdateCommand::class)
            ->withArguments([
                \Symfony\Component\Filesystem\Filesystem::class,
                \Symfony\Component\Finder\Finder::class,
            ]);
    }
386353
protected function addImpliedCommands()
    {
        if (count($this->columns) > 0 && ! $this->creating()) {
            array_unshift($this->commands, $this->createCommand('add'));
        }

        $this->addFluentIndexes();
    }
209035
public function actionAdmin() {
		$response = $this->app->resolve( WPEMERGE_RESPONSE_KEY );

		if ( $response === null ) {
			return;
		}

		Response::sendBody( $response );
	}
351555
def admin(module):
    """"""
    # add module into admin site
    app = os.getcwd().split('/')[-1]
    if app != 'app':
        logger.warning('''\033[31m{Warning}\033[0m
==> your current path is \033[32m%s\033[0m\n
==> please add your sql module under app folder!''' % os.getcwd())
        exit(1)

    admin_path = os.path.join(os.getcwd(), 'admin')
    os.chdir(admin_path)
    with open('views.py', 'r+') as f:
        prev = pos = 0
        while f.readline():
            prev, pos = pos, f.tell()
        f.seek(prev)
        f.write(
            '\nfrom app.models import %s\nadmin.add_view(ModelView(%s, db.session))'
            % (module, module)
        )

    logger.info('''\033[33m{Info}\033[0m: add module done!''')
1338171
public function addListCommands()
    {
        $entity = $this->getController()->getItem();

        if ($entity->authorize('vote')) {
            $this->addCommand('vote');
        }

        if ($entity->authorize('delete')) {
            $this->addCommand('delete');
        }

        if ($entity->authorize('edit')) {
          $this->addCommand('view', AnTranslator::_('LIB-AN-MEDIUM-VIEW'))
               ->getCommand('view')
               ->href(route($entity->getURL()));
        }
    }
289266
def add_subcommands(parser, commands):
    ""
    subps = parser.add_subparsers()
    for cmd, cls in commands:
        subp = subps.add_parser(cmd, help=cls.__doc__)
        add_args = getattr(cls, 'add_arguments', None)
        if add_args:
            add_args(subp)
        handler = getattr(cls, 'handle', None)
        if handler:
            subp.set_defaults(handler=handler)
265019
public function addListCommands()
    {
        $comment = $this->getController()->getItem();

        if ($comment->authorize('vote')) {
            $this->addCommand('vote');
        }

        if ($comment->authorize('edit')) {
            $url = $comment->getURL().'&comment[layout]=form';

            if ($this->getController()->editor) {
                $url = $url.'&comment[editor]=1';
            }

            $this->addCommand('editcomment', AnTranslator::_('LIB-AN-ACTION-EDIT'))
                ->getCommand('editcomment')
                ->href(route($url))
                ->class('action-edit');
        }

        if ($comment->authorize('delete')) {
            $this->addCommand('deletecomment', AnTranslator::_('LIB-AN-ACTION-DELETE'))
                ->getCommand('deletecomment')
                ->href(route($comment->getURL()))
                ->class('action-delete');
        }
    }
688511
def add_command(self, handler, name=None):
        
        if name is None:
            name = docstring_to_subcommand(handler.__doc__)

        # TODO: Prevent overwriting 'help'?
        self._commands[name] = handler
372733
public function add_deferred_commands() {
		$deferred_additions = \WP_CLI::get_deferred_additions();

		foreach ( $deferred_additions as $name => $addition ) {
			\WP_CLI::debug(
				sprintf(
					'Adding deferred command: %s => %s',
					$name,
					json_encode( $addition )
				),
				'bootstrap'
			);

			\WP_CLI::add_command(
				$name,
				$addition['callable'],
				$addition['args']
			);
		}
	}