Quinoa
[ class tree: Quinoa ] [ index: Quinoa ] [ all elements ]

Class: Quinoa_Entity

Source Location: /Quinoa/Entity.php

Class Overview

Quinoa_Data
   |
   --Quinoa_Entity

Quinoa Entity class.


Author(s):

Version:

  • 0.0.21 2007-09-23

Copyright:

  • 2007

Variables

Methods


Inherited Variables

Inherited Methods

Class: Quinoa_Data

Quinoa_Data::__construct()
Constructs a Quinoa_Data object.
Quinoa_Data::delete()
Get the sql for deletion and runs the query returning the number of
Quinoa_Data::execute()
Used for retrieving.
Quinoa_Data::getAffectedRows()
Get the number of rows affected in the last operation
Quinoa_Data::getCount()
Runs a query replacing the fields for a count function
Quinoa_Data::getLastId()
Get the last autonumbered id inserted
Quinoa_Data::insert()
Get the sql for insertion and runs the query returning the number of
Quinoa_Data::retrieveLightRecordList()
Retrieve a record list and return it as an array
Quinoa_Data::retrieveRecordList()
Runs a query and fetch the results in a Quinoa_Recordlist
Quinoa_Data::retrieveScalar()
Retrieves a query and returns the left most attribute as a scalar
Quinoa_Data::run()
Simply runs a query in row SQL format
Quinoa_Data::setFetchType()
fetchType set accessor
Quinoa_Data::update()
Get the sql for update and runs the query returning the number of

Class Details

[line 47]
Quinoa Entity class.

Quinoa Entity class. Quinoa_Entity adds to the low level Quinoa_Data its high level methods. It's the class inherited by all classes we write in the data layer of our Quinoa projects. PHP version 5.x Copyright (c) 2007, Freeconcept, Lda. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Freeconcept, Lda. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.




Tags:

since:  File available since Release 0.0.1
abstract:  
link:  http://www.quinoaframework.org
version:  0.0.21 2007-09-23
copyright:  2007
author:  Marcello Duarte <marcello.duarte@gmail.com>


[ Top ]


Class Variables

$_attributes =

[line 55]

Attributes of the entity

Attributes of the entity




Tags:

access:  protected

Type:   Quinoa_Attribute[]


[ Top ]

$_database =

[line 62]

Database name

Database name




Tags:

access:  protected

Type:   string


[ Top ]

$_primaryKey =

[line 76]

primary key of the entity

primary key of the entity




Tags:

access:  protected

Type:   mixed


[ Top ]

$_tables =

[line 69]

Table name

Table name




Tags:

access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 85]

Quinoa_Entity __construct( )

Constructs a Quinoa_Entity object Calls the defineAttributes method which is mandatory in for the classes inheriting it.

Constructs a Quinoa_Entity object Calls the defineAttributes method which is mandatory in for the classes inheriting it.




Tags:

access:  public
see:  Quinoa_Interface_Entity


Overrides Quinoa_Data::__construct() (Constructs a Quinoa_Data object.)

[ Top ]

method addAttribute [line 480]

void addAttribute( unknown_type $attribute)

Adda an attribute to the data class

Adda an attribute to the data class




Tags:

access:  public


Parameters:

unknown_type   $attribute  

[ Top ]

method create [line 336]

void create( Quinoa_Record $record)

High level insertion.

High level insertion. Receives a Quinoa_Record and creates an record in the database




Tags:

access:  public


Parameters:

Quinoa_Record   $record  

[ Top ]

method createOrUpdate [line 353]

void createOrUpdate( Quinoa_Record $record, [mixed $id = null], [boolean $primaryEditable = false])

High level insertion or update.

High level insertion or update. Receives a Quinoa_Record and creates if id given is null or updates an record in the database if id is given




Tags:

access:  public


Parameters:

Quinoa_Record   $record  
mixed   $id  
boolean   $primaryEditable  

[ Top ]

method defineAttributes [line 296]

void defineAttributes( )

Mandatory definition of entity attributes

Mandatory definition of entity attributes




Tags:

access:  public
see:  Quinoa_Interface_Entity


[ Top ]

method deleteMany [line 439]

void deleteMany( [mixed $condition = ""])

High level deletion upon condition

High level deletion upon condition




Tags:

access:  public


Parameters:

mixed   $condition  

[ Top ]

method deleteOne [line 397]

void deleteOne( integer $id)

High level deletion based on the id given

High level deletion based on the id given Only works for entities with a single primary key




Tags:

access:  public


Parameters:

integer   $id  

[ Top ]

method getAttribute [line 217]

Quinoa_Attribute getAttribute( string $name)

Gets an attribute given its name

Gets an attribute given its name




Tags:

access:  public


Parameters:

string   $name  

[ Top ]

method getAttributes [line 190]

Quinoa_Attribute[] getAttributes( )

get the array of Quinoa_Attribute of the entity

get the array of Quinoa_Attribute of the entity




Tags:

access:  public


[ Top ]

method getConditions [line 142]

array getConditions( )

get the conditions based on the entity relationships

get the conditions based on the entity relationships




Tags:

access:  public


[ Top ]

method getFields [line 114]

array getFields( )

get the fields defined in the attributes property

get the fields defined in the attributes property




Tags:

access:  public


[ Top ]

method getForeignType [line 168]

string getForeignType( string $type)

get the type defined in the external attribute

get the type defined in the external attribute




Tags:

access:  public


Parameters:

string   $type  

[ Top ]

method getLabels [line 303]

array getLabels( )

Gets an array with all the labels of the data class for display purposes

Gets an array with all the labels of the data class for display purposes




Tags:

access:  public


[ Top ]

method getNames [line 319]

array getNames( )

Gets an array with all the names of the data class

Gets an array with all the names of the data class




Tags:

access:  public


[ Top ]

method getPrimaryKey [line 180]

string getPrimaryKey( )

return the primary key defined for the entity

return the primary key defined for the entity




Tags:

access:  public


[ Top ]

method getSQLParams [line 247]

array getSQLParams( [string $operation = "SELECT"])

get the pieces of the SQL in an associative array

get the pieces of the SQL in an associative array




Tags:

access:  public


Parameters:

string   $operation  

[ Top ]

method getTables [line 96]

array getTables( )

get the tables defined in the inheriting data class

get the tables defined in the inheriting data class




Tags:

access:  public


[ Top ]

method hasSet [line 200]

unknown hasSet( )

Checks whether the data class defines a set as an attribute

Checks whether the data class defines a set as an attribute




Tags:

access:  public


[ Top ]

method removeAttribute [line 490]

void removeAttribute( string $name)

Removes an attribute of a data class given its name

Removes an attribute of a data class given its name




Tags:

access:  public


Parameters:

string   $name  

[ Top ]

method retrieveAll [line 455]

Quinoa_Recordlist retrieveAll( [integer $maxRecords = ""], [integer $start = 0], [boolean $getCount = false])

High level retrieving all records of a entity

High level retrieving all records of a entity




Tags:

access:  public


Parameters:

integer   $maxRecords  
integer   $start  
boolean   $getCount  

[ Top ]

method retrieveMany [line 495]

void retrieveMany( [mixed $conditions = ""], [mixed $maxRecords = ""], [mixed $start = 0], [mixed $getCount = false])



Tags:

access:  public


[ Top ]

method retrieveOne [line 413]

Quinoa_Recordlist retrieveOne( mixed $id)

High level retrieving based on the id given

High level retrieving based on the id given Also works with composed primary keys




Tags:

access:  public


Parameters:

mixed   $id  

[ Top ]

method setTable [line 470]

void setTable( string $table, [integer $i = 0])

tables set accessor

tables set accessor




Tags:

access:  public


Parameters:

string   $table  
integer   $i  

[ Top ]


Documentation generated on Wed, 03 Oct 2007 14:25:31 +0100 by phpDocumentor 1.3.0RC3