Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 1.24 KB

File metadata and controls

39 lines (24 loc) · 1.24 KB

Build Status

PropelRelationIsModifiedBehavior

==================================

Extends the isModified method to support checking the related objects for changes, in the way that doSave can save changes to related objects.

Installation

Add it to your composer.json:

{
    "require": {
        "bjdelange/propelrelationismodifiedbehavior": "1.0.*"
    }
}

Add it to Propel's build.properties:

propel.behavior.relationismodifiedbehavior.class = RelationIsModifiedBehavior

Usage

In your schema.xml, add the behavior at database or table level where you need it

<database name="default" defaultIdMethod="native">
    <behavior name="relationismodifiedbehavior" />
    ...

and rebuild your model.

propel-gen om

The affected table classes will now have an boolean option added to their isModified() methods that allow for checking related objects in addition to their own fields (which isModified already did).

Example

The accompanying tests should be more than enough to get started.