Reading notes (Master joomla1.5 Chapter The database: JTable 04)

2010-07-06  来源:本站原创  分类:PHP  人气:148 

The official interpretation of JTable

/ **
* Abstract Table class / / abstract table class personally think that is the parent class dao
*
* Parent classes to all tables.
*
* @ Abstract
* @ Package Joomla.Framework
* @ Subpackage Table
* @ Since 1.0
* @ Tutorial Joomla.Framework / jtable.cls
* /

It is the parent class for each table, see that it is fully based on the table to design (...). the database connection $ db variable as an example.

Articles about: In order to use JTable: getInstance () / / return an instance of the table

In fact the JTable's function & getInstance ($ type, $ prefix = 'JTable', $ config = array ()) to achieve inside

Reflection to instantiate a specific table object.

$ Instance = new $ tableClass ($ db);
/ / $ Instance-> setDBO ($ db);

return $ instance;

With each subclass must override constructor. Look Aro table

/ **
* Aro table
*
* @ Package Joomla.Framework
* @ Subpackage Table
* @ Since 1.0
* /
class JTableARO extends JTable
(
/ ** @ Var int Primary key * /
var $ id = null;

var $ section_value = null;

var $ value = null;

var $ order_value = null;

var $ name = null;

var $ hidden = null;

function __construct (& $ db)
(
parent:: __construct ('# __core_acl_aro', 'aro_id', $ db); / / table name, primary key, the database connection object

/ / Odd composite primary key to how to handle it?
)
)

/ / To be continued ...

相关文章
  • Reading notes (Master joomla1.5 Chapter The database: JTable 04) 2010-07-06

    The official interpretation of JTable / ** * Abstract Table class / / abstract table class personally think that is the parent class dao * * Parent classes to all tables. * * @ Abstract * @ Package Joomla.Framework * @ Subpackage Table * @ Since 1.0

  • Reading notes (Master joomla1.5 Chapter III The database 02) 2010-07-06

    loadAssocList: public function test_loadAssocList () ( echo "loadAssocList: \ n"; $ This-> assertNotNull ($ this-> db); $ Query = "SELECT * FROM" . $ This-> db-> nameQuote ('#__ newsfeeds'); $ This-> db-> setQuery ($

  • Reading notes (Master joomla1.5 Chapter III The database 03) 2010-07-06

    loadObject: / / return an instance of stdClass class public function test_loadObject () ( $ Query = "SELECT name FROM" . $ This-> db-> nameQuote ('#__ users'); $ This-> db-> setQuery ($ query); print_r ($ this-> db-> loadObject

  • Reading notes (Master joomla1.5 Chapter III The database01) 2010-07-06

    Joomla 1.5 db-schema: http://dev.joomla.org/downloads/Joomla15_DB-Schema.htm / / Network articles: http://qkzz.net/article/c0c7142f-2d5b-4808-933a-f648d9397ba8_2.htm Return result set loadResult / / return the first row, first field loadObject / / re

  • Reading notes (Master joomla1.5 Chapter The database01) 2010-07-06

    Joomla 1.5 db-schema: http://dev.joomla.org/downloads/Joomla15_DB-Schema.htm / / Network articles: http://qkzz.net/article/c0c7142f-2d5b-4808-933a-f648d9397ba8_2.htm Return result set loadResult / / return the first row, first field loadObject / / re

  • Long Tail Theory Reading Notes: A Brief History Chapter Elliot 2010-04-11

    Elliot is the pinnacle of a series of business innovations, these innovations mainly in the production, supply, distribution and sale of goods methods, such as Internet shopping can be realized for all elements of non-Internet: Federal Express, Inter

  • Reading notes for the 20th chapter 'Broadcasting' of unp. 2011-08-28

    We know that information transmission means through the Ethernet consist of unicasting, multicasting, anycasting and broadcasting. The following table show differen forms of addressing. Type IPv4 IPv6 TCP UDP # IP interfaces identified # IP interface

  • Reading Notes: Enterprise JavaBeans, 3.0 Chapter 1. Introduction 2010-07-31

    Reading Notes: Enterprise JavaBeans, 3.0 Chapter 1. Introduction 1.1. Server-Side Components In business systems, object-oriented languages are used to improve development of GUIs, to simplify access to data, and to encapsulate the business logic. A

  • Reading notes on the code refactoring (1) 2010-04-16

    AgileJava reading notes (1) AgileJava is a test-driven development based on the method to help you learn how to polish your Java code, and thus obtain a stable object-oriented design and high-maintainable, high-quality systems. The book with a studen

  • Reading Notes: Your First Cup: An Introduction to the Java EE Platform 2010-07-10

    Reading Notes: Your First Cup: An Introduction to the Java EE Platform 1. Differences Among Three platforms Java technology is both a programming language and a platform. The Java programming language is a high-level object-oriented language that has

  • javascript DOM programming arts reading notes 2010-09-06

    javascript DOM programming arts reading notes The first part of the directory Chapter 1 Origin of JavaScript 1.1 JavaScript 1.2 A Brief History of the browser war 1.3 standard 1.4 Summary Chapter 2, JavaScript 2.2 Grammar 2.1 Grammar 2.3 statement pr

  • JUnit In Action Reading Notes (1) 2008-03-29

    JUnit In Action Reading Notes (1) Part1 JUnit distilled chapter1 will teach you what the JUnit framework is and what problems it solves. chapter2 will take you on a discovery tour of the core JUnit classes and how to best use them. chapter3, you'll p

  • Continued integration of reading notes 2010-03-17

    "Continuous integration software quality improvement and risk reduction of the Road" Continued integration of all of the people interested in the topic should read this book, but quickly browse again on the trip, the theme, after all, is a very

  • Reading notes (1) array 2010-05-04

    Reading notes 1. In c + +, there are two ways the array statements: one is to use the built-in array; Another is to use Vector. Vector is much easier to use and more secure than the basic element array, and should therefore be preferred to use Vector

  • <Software Architecture Design> reading notes notes 2010-05-07

    "Software Architecture Design" reading notes http://uptodate.javaeye.com/blog/346676 Domain model lack of knowledge, not in-depth understanding of Robustness analysis?

  • Reading Notes explain design pattern mode (Interpreter pattern) 2010-10-28

    Interpreter Pattern: Given a language, define a representation of its grammar, and define an interpreter, the interpreter uses the representation to interpret sentences in the language. By the definition, does not explain the mode is a commonly used

  • Reading Notes: Based on fuzzy c-means algorithm for data classification and forecasting of space - Hu Caiping. Qin Xiaolin 2010-11-06

    Reading Notes: Based on fuzzy c-means algorithm for data classification and forecasting of space - Hucai Ping, Qin Xiaolin Background Introduction c-means c-means clustering method is the most common and most commonly used method, in the "Data Mining

  • Continuous Integration reading notes 2010-03-17

    "Continuous quality improvement and integrated software to reduce the risk of the Road." Subject to the continuous integration of all who are interested should read this book, but quickly go over the line, after all, this theme is a very practic

  • Oracle +9 i & 10g art of programming: in-depth database architecture, reading notes / summary 2010-12-27

    Abstract: Successful development of Chapter 1 of Oracle Applications Bitmap index is only applicable to low base (low-cardinality) value, but the frequently updated list does not apply. (So-called low cardinality column refers to this column can be o

  • Reading Notes: Enterprise JavaBeans, 3.0 Chapter 2. Architectural Overview 2010-08-01

    Enterprise JavaBeans, 3.0 Chapter 2. Architectural Overview Section 2.1. The Entity Bean A good rule of thumb is that entity beans model business concepts that can be expressed as nouns. For example, an entity bean might represent a customer, a piece