2017 © Pedro Peláez
 

library propel-helper

Propel helper - helper classes (traits) for Propel2 ORM

image

ansas/propel-helper

Propel helper - helper classes (traits) for Propel2 ORM

  • Friday, January 5, 2018
  • by dhm80
  • Repository
  • 2 Watchers
  • 1 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 5 % Grown

The README.md

Propel helper

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Helper classes (traits) for Propel2 ORM., (*2)

Ansas\Propel\Helper\ReadOnly

This trait is a workaround for the Propel bug that you cannot use joinWith() methods anymore when setting tables to readOnly="true" in Propel's schema.xml file. So instead of making tables "readonly" in the scheme just add this trait to every child model you want to make readonly., (*3)

For details see https://github.com/propelorm/Propel2/issues/629, (*4)

Example usage:, (*5)

<?php

use Base\User as BaseUser;
use Ansas\Propel\Helper\ReadOnly;

class User extends BaseUser
{
    use ReadOnly;
}

Ansas\Propel\Helper\SimpleVersionableBehavior

The default behavior "versionable" does not seem to work well with relations and in combination with other behaviors. Therefore I wrote a "simple trait" that does NOT consider versions of related tables. All methods can be used as before., (*6)

Three things have to be implemented to use this trait:, (*7)

  1. Use the trait in the desired class
  2. Add the following constant with the name of the versionable behavior active records class (e. g. for an 'Account')
  3. Optionally add the constant for column names (in default PhpName notation) to skip when populating object

Example usage:, (*8)

<?php

use Base\User as BaseUser;
use Ansas\Propel\Helper\SimpleVersionableBehavior;

class User extends BaseUser
{
    use SimpleVersionableBehavior;

    /**
     * Class name for versionable behavior active records
     */
    const VERSIONABLE_CLASS = 'UserVersion';

    /**
     * Column names (in default PhpName notation) to skip when populating this with version entry
     */
    const VERSIONABLE_POPULATE_SKIP_COLUMNS = ['UpdatedAt', 'Version'];
}

Ansas\Propel\Helper\Validation

This trait makes validation of an object quite easy., (*9)

Methods:, (*10)

protected function addValidationError($key, $value, $overwrite = true)
protected function resetValidation()
public function getValidationErrors()
public function hasValidationErrors()
abstract protected function doValidate();

TODO

  • Write tests

Contribute

Everybody can contribute to this package. Just:, (*11)

  1. fork it,
  2. make your changes and
  3. send a pull request.

Please make sure to follow PSR-1 and PSR-2 coding conventions., (*12)

License

__MIT license__ (see the LICENSE file for more information)., (*13)

The Versions

05/01 2018

dev-master

9999999-dev

Propel helper - helper classes (traits) for Propel2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper propel readonly

05/01 2018

dev-develop

dev-develop

Propel helper - helper classes (traits) for Propel2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper propel readonly

05/01 2018

1.3.4

1.3.4.0

Propel helper - helper classes (traits) for Propel2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper propel readonly

03/04 2017

1.3.3

1.3.3.0

Propel helper - helper classes (traits) for Propel2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper propel readonly

08/09 2016

1.3.2

1.3.2.0

Propel helper - helper classes (traits) for Propel2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper propel readonly

29/08 2016

1.3.1

1.3.1.0

Propel helper - helper classes (traits) for Propel2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper propel readonly

25/08 2016

1.3.0

1.3.0.0

Helper classes for Propel 2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper propel readonly

29/04 2016

1.2.1

1.2.1.0

Helper classes for Propel 2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper propel readonly

29/04 2016

1.2.0

1.2.0.0

Helper classes for Propel 2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper propel readonly

13/01 2016

1.1.0

1.1.0.0 https://github.com/dhm80/propel-helper

Helper classes for Propel 2 ORM

  Sources   Download

MIT

The Requires

 

orm validation helper manipulation propel readonly

24/08 2014

1.0.0

1.0.0.0 https://github.com/dhm80/PropelHelper

Helper classes for Propel 2 ORM

  Sources   Download

MIT

The Requires

 

orm helper propel readonly