DAO classes isolate developers of all the intricacies of the database structure, so that for example loading a post from the dabase is as easy as:
$articles = new Articles(); $userPost = $arcticles->getBlogArticle( 15 );
Otherwise, developers would need to write an SQL query every time we need to load an article from the database. In general, DAO classes provide access to reading, updating and removing data from the database. In pLog, we usually have two classes per entity: a smaller one that contains no database access logic and that only contains the information necessary (usually, it represents a row from the database), and the second will be a bigger class that includes SQL code and database logic and that provides all the methods outlined above (read, update and remove from the database) Examples of this are Articles and Article, or Users and UserInfo.
Other relevant DAO classes are ArticleComments and UserComment, MyLink and MyLinks, etc.
All classes that extend the base Model class, automatically inherit an open connection to the database * (via the private attribute Model._db) and several other database-related methods.
Furthermore all classes that extend the base Model class gets a reference to the global disk-based cache. More information on how to use the cache can be found in the Cache Group
If you need to implement some kind of data access, please extend from Model.
| enum CUSTOM_FIELD_TEXTBOX |
different custom field types available
Definition at line 13 of file customfields.class.php.