Commit graph

94 commits

Author SHA1 Message Date
Josh Sherman
bea6b0f645 Fixed issue when executing Model->commit() and no data has changed 2011-01-02 01:17:57 -05:00
Josh Sherman
4219813440 Stripped white space between folds, I found it too hard to read. 2011-01-02 01:06:32 -05:00
Josh Sherman
97bd8163a2 Added comments. 2010-12-18 20:16:44 -05:00
josh
f0c3435a0b Fixed issues with defaulting the array to the conditionals. 2010-12-18 01:20:40 -05:00
Josh Sherman
9c9407843e Added support for boolean conditionals (IS [NOT] (TRUE|FALSE)) 2010-12-12 21:42:58 -05:00
Josh Sherman
42af200c9b Updated Model to use the model specific variables when generating the "all" query. 2010-12-12 21:04:36 -05:00
Josh Sherman
a72f49f2b4 Made options array non-case sensitive 2010-12-09 20:19:03 -05:00
Josh Sherman
89e2c3db19 Cleaned up stray whitespace. 2010-12-09 20:12:05 -05:00
Josh Sherman
015902ca93 Updated Model to support an array being passed in and not have to be nested inside of a conditions key. 2010-12-04 13:41:55 -05:00
Josh Sherman
7cf3e5dadf Fixed issue where Model was dying if only passed an integer (presumably the ID of a row) 2010-12-02 23:39:46 -05:00
Josh Sherman
bae3f9de63 array_diff was not catching values of 1. 2010-11-28 18:33:59 -05:00
Josh Sherman
1a863bac63 Added documentation for an argument. 2010-11-27 22:48:52 -05:00
Josh Sherman
42c3ec993b Removed commented code from the Model and added a note about how experimental and unusable the Mongo class is. 2010-11-27 21:42:50 -05:00
Josh Sherman
3e7ece8cce Fixed issues when generating SQL conditionals. 2010-11-27 18:00:13 -05:00
Josh Sherman
7e1a45e9cb Added support for index hinting. 2010-11-26 23:16:56 -05:00
Josh Sherman
6205ad7809 Added support for dynamically setting the ID column in a Model. 2010-11-26 19:19:54 -05:00
Josh Sherman
43dd8f16ab Added JOIN support in the Model. 2010-11-26 15:31:58 -05:00
Josh Sherman
795594a391 Started adding support for Mongo in the Model class. Also removed fetchAll and fetchColumn methods, all data is returned as an associative array for consistency and to simplify the fetching logic. 2010-10-31 14:34:39 -04:00
Josh Sherman
2325e79f3c Updated @todo. 2010-10-31 11:23:28 -04:00
Josh Sherman
0729d46281 Updated Model updates to limit the number of columns being set to only the columns that have changed. 2010-10-30 22:05:51 -04:00
Josh Sherman
f24880d12d Updated manipulation functions and added folding. 2010-10-28 22:15:01 -04:00
Josh Sherman
1cd61dda42 Updated licensing to use the [better suited] MIT License. 2010-10-14 20:12:40 -04:00
Josh Sherman
1cb7980353 Moved PDO classes into Database/PDO and gave data models the ability to know which datasource to use. 2010-10-13 23:41:27 -04:00
Josh Sherman
520d841500 Removed whitespace. 2010-10-03 15:09:29 -04:00
Josh Sherman
e0e2a87aaa Rebuilt the Model class. 2010-10-03 15:07:28 -04:00
Josh Sherman
28525dcf08 Updated Database class interaction to use Singleton getInstance() method. 2010-09-30 21:51:28 -04:00
Josh Sherman
9e7e78c59f Added functionality to create models on the fly.
Instead of creating a class for a model you can simply instantiate the Model class and pass (at minimum) the name of the table.

	Example: new Model('TABLE' => 'pickles');

The capitalization is important when passing in "reserved" words to the model.
2010-05-15 23:42:49 -04:00
Josh Sherman
a48706da4b Removed whitespace. 2010-05-15 22:51:17 -04:00
Josh Sherman
a901d73dac Added support for ORDER BY and LIMIT
Also added in additional methods to travel the record set.
2010-05-15 22:47:16 -04:00
Josh Sherman
8146c2584d Updated SQL generation logic in Model class.
* Found a bug with column values containing IS anywhere in the string.

 * Updated both the column check and value check to include a preceeding space (column) and trailing space (value) to correct the issue.
2010-03-17 21:49:17 -04:00
Josh Sherman
cda9c7d28e Implementing the Database class.
* Updated the Database class to work like a Singleton with a getInstance() method.

 * The Database class does not have a private constructor so it can still be instantiated in case someone needs to do so.

 * Replaced Logger class with Log class.

 * Updated Module to have an instance of the Database object as well as the Model class.

 * In my perfect vision for usage, the Module classes should never talk directly to the database, but do so via Models, but I know that's asking a lot, so I'm leaving in some options for folks.

 * Updated documentation.
2010-03-16 22:54:21 -04:00
Josh Sherman
56038e3871 Added Model class.
* The Model class is what all data models should be extending.
2010-03-12 23:43:00 -05:00
Josh Sherman
b53f52ac1e Changes.
git-svn-id: http://svn.cleancode.org/svn/pickles@79 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-10-18 13:42:10 +00:00
Josh Sherman
d2d6c47682 Changed the core Object to not require any params in the constructor, and now we rely on polymorphism in the classes themselves to override that.
git-svn-id: http://svn.cleancode.org/svn/pickles@74 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-10-14 13:27:26 +00:00
Josh Sherman
9bdd0b3045 Cleaned up white space, also updated the RSS viewer to not use Config::getInstance()
git-svn-id: http://svn.cleancode.org/svn/pickles@71 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-10-11 21:59:42 +00:00
Josh Sherman
b25ba0992a Swapped out the Mail class for the Mailer class (it's better and smarter)
git-svn-id: http://svn.cleancode.org/svn/pickles@70 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-10-11 21:42:46 +00:00
Josh Sherman
20fd236cb0 Updated the Error class from a static class to an instantiatable one.
git-svn-id: http://svn.cleancode.org/svn/pickles@68 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-10-11 20:16:47 +00:00
Josh Sherman
ecf86b9818 Removed the Singleton class, removed the ImageUtils class (for now) and switched the DB class to be an instantiated object and not a Singleton.
git-svn-id: http://svn.cleancode.org/svn/pickles@67 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-10-10 01:56:17 +00:00
Josh Sherman
e9f8b555d3 Quite possibly the largest commit in PICKLES history, shy of perhaps the initial revision. Bunches of restructuring and refactoring and all that.
git-svn-id: http://svn.cleancode.org/svn/pickles@61 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-10-09 05:12:31 +00:00
Josh Sherman
fcf1ffde4e Updated the Config class to use objects instead of an array (overriding __get() saved some effort). Also refactored some code, and updated the controller (partially) to handle shared models.
git-svn-id: http://svn.cleancode.org/svn/pickles@60 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-10-04 23:48:03 +00:00
Josh Sherman
d38196073a Made a bunch of changes, as per usual.
git-svn-id: http://svn.cleancode.org/svn/pickles@59 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-10-03 01:37:45 +00:00
Josh Sherman
e02ded351d Updates all over. Redid some of the doc blocks cause they weren't to scale of a vim session with lline numbers on (still may not be... ugh). Also changed around some of the model level variables and stuff.
git-svn-id: http://svn.cleancode.org/svn/pickles@58 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-09-24 03:37:09 +00:00
Josh Sherman
1784514696 Massive amounts of documentation has been added.
git-svn-id: http://svn.cleancode.org/svn/pickles@55 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-09-22 01:43:18 +00:00
Josh Sherman
046d265347 Added the new classes and stuff.
git-svn-id: http://svn.cleancode.org/svn/pickles@30 4d10bc64-7434-11dc-a737-d2d0f8310089
2008-07-12 23:28:44 +00:00