From 52f8f02d6902fb52bf7fb596c74c1a856b14b1a8 Mon Sep 17 00:00:00 2001 From: Marco Monteiro Date: Thu, 19 Nov 2020 10:12:41 +0000 Subject: [PATCH] Updated email and filter snippets and created new ones for new version --- README.md | 36 +++++++++++++++-------- ci4_affectedRows.sublime-snippet | 8 +++++ ci4_countAll.sublime-snippet | 8 +++++ ci4_db_from.sublime-snippet | 8 +++++ ci4_db_join.sublime-snippet | 8 +++++ ci4_db_whereNotIn.sublime-snippet | 8 +++++ ci4_db_whereNotInSubquery.sublime-snippet | 10 +++++++ ci4_email_config.sublime-snippet | 14 ++++----- ci4_filter.sublime-snippet | 4 +-- ci4_getPlatform.sublime-snippet | 8 +++++ ci4_getVersion.sublime-snippet | 8 +++++ ci4_insertID.sublime-snippet | 8 +++++ ci4_lastQuery.sublime-snippet | 8 +++++ messages.json | 3 +- messages/1.1.11.txt | 17 +++++++++++ 15 files changed, 134 insertions(+), 22 deletions(-) create mode 100644 ci4_affectedRows.sublime-snippet create mode 100644 ci4_countAll.sublime-snippet create mode 100644 ci4_db_from.sublime-snippet create mode 100644 ci4_db_join.sublime-snippet create mode 100644 ci4_db_whereNotIn.sublime-snippet create mode 100644 ci4_db_whereNotInSubquery.sublime-snippet create mode 100644 ci4_getPlatform.sublime-snippet create mode 100644 ci4_getVersion.sublime-snippet create mode 100644 ci4_insertID.sublime-snippet create mode 100644 ci4_lastQuery.sublime-snippet create mode 100644 messages/1.1.11.txt diff --git a/README.md b/README.md index 776947c..e43eab0 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ If you find error or whatever just fork it and send me a pull request. | ci_new_renderer | New View Renderer | | ci_render_section =ci_log | Logging information> Render section view | | ci_extend_layout | Extend layout (insert view into a layout) | -| ci_view_section | View section (content within a view that extends a layout) +| ci_view_section | View section (content within a view that extends a layout) | ci_view_include | View include | | ci_get_locale | Get Locale | | load_database | Load the Database | @@ -54,17 +54,29 @@ If you find error or whatever just fork it and send me a pull request. | ci_iscli | Check if request is CLI | | ci_issecure | Check if request is HTTPS | | ci_log | Logging information | -| ci_filter | Create a new filter class | -| ci_db_conn | Create a new database connection | -| ci_entity | Create a new Entity class | -| ci_cache | Save into the cache for x minutes | -| ci_getcache | Grab an instance of the cache engine directly through the Services class | -| ci_email | Basic example demonstrating how you might send email | -| ci_email_config | Basic email Preferences | -| ci_html_table | Create a basic html table based in a given array | -| ci_query_table | Create a basic html table based in query result | -| ci_table_template | Set your basic html table layout | -| ci_inicontroller | Create an init controller function | +| ci_filter | Create a new filter class | +| ci_db_conn | Create a new database connection | +| ci_entity | Create a new Entity class | +| ci_cache | Save into the cache for x minutes | +| ci_getcache | Grab an instance of the cache engine directly through the Services class | +| ci_email | Basic example demonstrating how you might send email | +| ci_email_config | Basic email Preferences | +| ci_html_table | Create a basic html table based in a given array | +| ci_query_table | Create a basic html table based in query result | +| ci_table_template | Set your basic html table layout | +| ci_inicontroller | Create an init controller function | +| ci4_affectedRows | Query builder get the affected rows | +| ci4_countAll | Query builder count all results | +| ci4_db_from | Query builder set From | +| ci4_db_join | Query builder set Join | +| ci4_db_whereNotIn | Query builder Where Not In | +| ci4_db_whereNotInSubquery | Query builder where not in with subquery | +| ci4_getPlatform | Get DB platform | +| ci4_getVersion | Get DB Version | +| ci4_insertID | Get inserted ID | +| ci4_lastQuery | Get last query from query builder | + + # Contributors diff --git a/ci4_affectedRows.sublime-snippet b/ci4_affectedRows.sublime-snippet new file mode 100644 index 0000000..1e35c3f --- /dev/null +++ b/ci4_affectedRows.sublime-snippet @@ -0,0 +1,8 @@ + + affectedRows(); +]]> + ci_affectedrows + source.php + CI4 - Displays the number of affected rows, when doing “write” type queries (insert, update, etc.). + \ No newline at end of file diff --git a/ci4_countAll.sublime-snippet b/ci4_countAll.sublime-snippet new file mode 100644 index 0000000..589079a --- /dev/null +++ b/ci4_countAll.sublime-snippet @@ -0,0 +1,8 @@ + + countAll(); +]]> + ci_countall + source.php + CI4 - Permits you to determine the number of rows in a particular table. Submit the table name in the first parameter. + \ No newline at end of file diff --git a/ci4_db_from.sublime-snippet b/ci4_db_from.sublime-snippet new file mode 100644 index 0000000..b938707 --- /dev/null +++ b/ci4_db_from.sublime-snippet @@ -0,0 +1,8 @@ + + from('${1:fields}'); +]]> + ci_from + source.php + CI4 - Permits you to write the FROM portion of your query + \ No newline at end of file diff --git a/ci4_db_join.sublime-snippet b/ci4_db_join.sublime-snippet new file mode 100644 index 0000000..d2d92d1 --- /dev/null +++ b/ci4_db_join.sublime-snippet @@ -0,0 +1,8 @@ + + join('${1:table_name}', '${2:table_name}.${3:pk} = ${4:table_name}.${1:fk}'); +]]> + ci_join + source.php + CI4 - Permits you to write the JOIN portion of your query: + \ No newline at end of file diff --git a/ci4_db_whereNotIn.sublime-snippet b/ci4_db_whereNotIn.sublime-snippet new file mode 100644 index 0000000..fce08e8 --- /dev/null +++ b/ci4_db_whereNotIn.sublime-snippet @@ -0,0 +1,8 @@ + + whereNotIn('${1:field}', \$${1:array}); +]]> + ci_db_notin + source.php + CI4 - Generates a WHERE field NOT IN (‘item’, ‘item’) SQL query joined with AND if appropriate + \ No newline at end of file diff --git a/ci4_db_whereNotInSubquery.sublime-snippet b/ci4_db_whereNotInSubquery.sublime-snippet new file mode 100644 index 0000000..351dd55 --- /dev/null +++ b/ci4_db_whereNotInSubquery.sublime-snippet @@ -0,0 +1,10 @@ + + orWhereNotIn('${1:field}', function(BaseBuilder \$builder) { + return \$builder->select('${2:field}')->from('${3:table}')->where('${4:field}', ${5:value}); +}); +]]> + ci_db_notinsub + source.php + CI4 - Generates a WHERE field NOT IN (‘item’, ‘item’) SQL query joined with OR if appropriate with subqueries instead of an array of values. + \ No newline at end of file diff --git a/ci4_email_config.sublime-snippet b/ci4_email_config.sublime-snippet index 3c4db45..2097402 100644 --- a/ci4_email_config.sublime-snippet +++ b/ci4_email_config.sublime-snippet @@ -1,12 +1,12 @@ initialize($config); ]]> diff --git a/ci4_filter.sublime-snippet b/ci4_filter.sublime-snippet index 71963d1..308b460 100644 --- a/ci4_filter.sublime-snippet +++ b/ci4_filter.sublime-snippet @@ -8,14 +8,14 @@ use CodeIgniter\Filters\FilterInterface; class ${1:${TM_FILENAME/(.+)\..+|.*/\u$1/:FilterName}}Filter implements FilterInterface { - public function before(RequestInterface $request) + public function before(RequestInterface \$request, \$arguments = null) { ${2} } //-------------------------------------------------------------------- - public function after(RequestInterface $request, ResponseInterface $response) + public function after(RequestInterface \$request, ResponseInterface \$response, \$arguments = null) { ${3} } diff --git a/ci4_getPlatform.sublime-snippet b/ci4_getPlatform.sublime-snippet new file mode 100644 index 0000000..6eb8c87 --- /dev/null +++ b/ci4_getPlatform.sublime-snippet @@ -0,0 +1,8 @@ + + getPlatform(); +]]> + ci_getplatform + source.php + CI4 - Outputs the database platform you are running (MySQL, MS SQL, Postgres, etc…) + \ No newline at end of file diff --git a/ci4_getVersion.sublime-snippet b/ci4_getVersion.sublime-snippet new file mode 100644 index 0000000..5f88a4e --- /dev/null +++ b/ci4_getVersion.sublime-snippet @@ -0,0 +1,8 @@ + + getVersion(); +]]> + ci_version + source.php + CI4 - Outputs the database version you are running + \ No newline at end of file diff --git a/ci4_insertID.sublime-snippet b/ci4_insertID.sublime-snippet new file mode 100644 index 0000000..471b0ef --- /dev/null +++ b/ci4_insertID.sublime-snippet @@ -0,0 +1,8 @@ + + insertID(); +]]> + ci_insertid + source.php + CI4 - The insert ID number when performing database inserts. + \ No newline at end of file diff --git a/ci4_lastQuery.sublime-snippet b/ci4_lastQuery.sublime-snippet new file mode 100644 index 0000000..35027ee --- /dev/null +++ b/ci4_lastQuery.sublime-snippet @@ -0,0 +1,8 @@ + + getLastQuery(); +]]> + ci_lastquery + source.php + CI4 - Returns a Query object that represents the last query that was run (the query string, not the result). + \ No newline at end of file diff --git a/messages.json b/messages.json index 6c18169..d99ff85 100644 --- a/messages.json +++ b/messages.json @@ -2,5 +2,6 @@ "install": "messages/install.txt", "1.0.20": "messages/1.0.20.txt", "1.0.24": "messages/1.0.24.txt", -"1.0.25": "messages/1.0.25.txt" +"1.0.25": "messages/1.0.25.txt", +"1.1.11": "messages/1.1.11.txt" } \ No newline at end of file diff --git a/messages/1.1.11.txt b/messages/1.1.11.txt new file mode 100644 index 0000000..0f51548 --- /dev/null +++ b/messages/1.1.11.txt @@ -0,0 +1,17 @@ +Added some more codeigniter 4 snippets to our repo + +ci4_affectedRows +ci4_countAll +ci4_db_from +ci4_db_join +ci4_db_whereNotIn +ci4_db_whereNotInSubquery +ci4_getPlatform +ci4_getVersion +ci4_insertID +ci4_lastQuery + +Fixed some existing snippets + +ci4_email_config +ci4_filter \ No newline at end of file