2017 © Pedro Peláez
 

propel-behavior query-inheritance-base-behavior

Propel 2 Query Inheritance Behavior to provide generic base query class for query inheritance objects

image

chq81/query-inheritance-base-behavior

Propel 2 Query Inheritance Behavior to provide generic base query class for query inheritance objects

  • Wednesday, February 18, 2015
  • by chq81
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,552 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

CustomQueryInheritanceBehavior for Propel 2

Propel 2 Behavior to customize the inheritance for query objects in a single inheritance setup, (*1)

License

MIT License, (*2)

copyright (c) 2015 Christoph Quadt, (*3)

Functionality

If there is a single inheritance set on a propel class, the current way of inheriting is:, (*4)

FantasyBookQuery
=> BaseFantasyBookQuery
=> BaseBookQuery
=> ModelCriteria

This Builder provides the following setup:, (*5)

FantasyBookQuery
=> BaseFantasyBookQuery
=> **BookQuery**
   or
=> **MyCustomQuery**
=> BaseBookQuery
=> ModelCriteria

Requirements

This behavior requires, (*6)

Installation

To enable the builder, you need to, (*7)

  1. reference the QueryInheritanceBehaviorBuilder as a custom builder in the propel settings:
propel.generator.objectModel.builders.queryinheritance = chq81\\CustomQueryInheritance\\Builder\\CustomQuerySingleInheritanceBuilder

2a. enable the behavior in the schema.xml for inheriting from the default query class (BookQuery):, (*8)

<table name="book">
  <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
  <column name="title" type="VARCHAR" required="true" />
  <column name="genre" phpName="Genre" type="INTEGER" size="11" required="true" defaultValue="0" inheritance="single">
    <inheritance key="1" class="FantasyBook" extends="Book" />
    <inheritance key="2" class="HorrorBook" extends="Book" />
  </column>
  <behavior name="custom-query-inheritance" />
</table>

2b. enable the behavior in the schema.xml for inheriting from the custom query class (MyCustomQuery):, (*9)

<table name="book">
  <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
  <column name="title" type="VARCHAR" required="true" />
  <column name="genre" phpName="Genre" type="INTEGER" size="11" required="true" defaultValue="0" inheritance="single">
    <inheritance key="1" class="FantasyBook" extends="Book" />
    <inheritance key="2" class="HorrorBook" extends="Book" />
  </column>
  <behavior name="custom-query-inheritance">
    <parameter name="base" value="[NAMESPACE]\\MyCustomQuery" />
  </behavior>
</table>

The Versions

18/02 2015

dev-master

9999999-dev

Propel 2 Query Inheritance Behavior to provide generic base query class for query inheritance objects

  Sources   Download

MIT

The Requires

 

by Christoph Quadt

query behavior base propel inheritance

17/02 2015

1.0.0

1.0.0.0

Propel 2 Query Inheritance Behavior to provide generic base query class for query inheritance objects

  Sources   Download

MIT

The Requires

 

by Christoph Quadt

query behavior base propel inheritance