We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Skip property on Collection save

I need a property that doesn't save for a Collection. I tried overriding Phalcon\Mvc\Collection::getReservedAttributes() and adding my property, but that doesn't work.

Is there something similar to Phalcon\Mvc\Model::skipAttributes() for Collections?


Phalcon rulez!


I hacked it like this. Static props don't save. I'd still like to know if there is a way to have a non-saving class property.

class Customer extends Phalcon\Mvc\Collection {

    // static properties not saved to Collection
    private static $currSubscription = null;

    // load Subscription when initialized
    public function initialize() {


    // load the Subscription when subscription id set
    public function setSubscriptionId($subId) {

        $this->subscriptionId = $subId;
        return $this;

    // get the Subscription
    public function getSubscription() {

        // only load if Subscription not loaded and subscription id set
        if(!self::$currSubscription && isset($this->subscriptionId) && $this->subscriptionId) {

            // load Subscription by id
            self::$currSubscription = Subscription::findById($this->subscriptionId);
        return self::$currSubscription;