PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TActiveRecordRelationContext

TActiveRecordRelationContext holds information regarding record relationships such as record relation property name, query criteria and foreign object record class names.

This class is use internally by passing a context to the TActiveRecordRelation constructor.

Package: System\Data\ActiveRecord\Relations
Copyright: Copyright © 2005-2014 PradoSoft
License: http://www.pradosoft.com/license/
Author: Wei Zhuo <weizho[at]gmail[dot]com>
Version: $Id$
Since: 3.1
Located at Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
Methods summary
public
# __construct( mixed $record, mixed $property = null, mixed $relation = null )
public boolean
# hasRecordRelation( )

Returns

boolean
true if the relation is defined in TActiveRecord::$RELATIONS

Since

3.1.2
public
# getPropertyValue( )
public string
# getProperty( )

Returns

string
name of the record property that the relationship results will be assigned to.
public TActiveRecord
# getSourceRecord( )

Returns

TActiveRecord
the active record instance that queried for its related records.
public array
# getRelationForeignKeys( )

Returns

array
foreign key of this relations, the keys is dependent on the relationship type.

Since

3.1.2
public string
# getRelationType( )

Returns

string
HAS_MANY, HAS_ONE, or BELONGS_TO
public string
# getForeignRecordClass( )

Returns

string
foreign record class name.
public string
# getFkField( )

Returns

string
foreign key field names, comma delimited.

Since

3.1.2
public string
# getCondition( )

Returns

string
the query condition for the relation as specified in RELATIONS

Since

3.1.2
public array
# getParameters( )

Returns

array
the query parameters for the relation as specified in RELATIONS

Since

3.1.2
public boolean
# hasFkField( )

Returns

boolean
true if the 3rd element of an TActiveRecord::$RELATION entry is set.

Since

3.1.2
public string
# getAssociationTable( )

Returns

string
the M-N relationship association table name.
public boolean
# hasAssociationTable( )

Returns

boolean
true if the relationship is HAS_MANY and requires an association table.
public TActiveRecord
# getForeignRecordFinder( )

Returns

TActiveRecord
corresponding relationship foreign object finder instance.
public TActiveRecordRelation
# getRelationHandler( TActiveRecordCriteria $criteria = null )

Creates and return the TActiveRecordRelation handler for specific relationships. An instance of TActiveRecordHasOne, TActiveRecordBelongsTo, TActiveRecordHasMany, or TActiveRecordHasManyAssocation will be returned.

Creates and return the TActiveRecordRelation handler for specific relationships. An instance of TActiveRecordHasOne, TActiveRecordBelongsTo, TActiveRecordHasMany, or TActiveRecordHasManyAssocation will be returned.

Parameters

$criteria
TActiveRecordCriteria
search criteria

Returns

TActiveRecordRelation
record relationship handler instnace.

Throws

TActiveRecordException
if property is not defined or missing.
public TActiveRecordRelationCommand
# updateAssociatedRecords( mixed $updateBelongsTo = false )

Returns

TActiveRecordRelationCommand
protected
# isEmptyFkObject( mixed $obj )
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO