Model/Base/CustomerGroup.php
public function getCustomerCustomerGroups($criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collCustomerCustomerGroupsPartial && !$this->isNew();
        if (null === $this->collCustomerCustomerGroups || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collCustomerCustomerGroups) {
                // return empty collection
                $this->initCustomerCustomerGroups();
            } else {
                $collCustomerCustomerGroups = ChildCustomerCustomerGroupQuery::create(null, $criteria)
                    ->filterByCustomerGroup($this)
                    ->find($con);

                if (null !== $criteria) {
                    if (false !== $this->collCustomerCustomerGroupsPartial && count($collCustomerCustomerGroups)) {
                        $this->initCustomerCustomerGroups(false);

                        foreach ($collCustomerCustomerGroups as $obj) {
                            if (false == $this->collCustomerCustomerGroups->contains($obj)) {
                                $this->collCustomerCustomerGroups->append($obj);
                            }
                        }

                        $this->collCustomerCustomerGroupsPartial = true;
                    }

                    reset($collCustomerCustomerGroups);

                    return $collCustomerCustomerGroups;
                }

                if ($partial && $this->collCustomerCustomerGroups) {
                    foreach ($this->collCustomerCustomerGroups as $obj) {
                        if ($obj->isNew()) {
                            $collCustomerCustomerGroups[] = $obj;
                        }
                    }
                }

                $this->collCustomerCustomerGroups = $collCustomerCustomerGroups;
                $this->collCustomerCustomerGroupsPartial = false;
            }
        }

        return $this->collCustomerCustomerGroups;
    }
public function getCustomerCustomerGroups($criteria = null, ConnectionInterface $con = null)
    {
        $partial = $this->collCustomerCustomerGroupsPartial && !$this->isNew();
        if (null === $this->collCustomerCustomerGroups || null !== $criteria  || $partial) {
            if ($this->isNew() && null === $this->collCustomerCustomerGroups) {
                // return empty collection
                $this->initCustomerCustomerGroups();
            } else {
                $collCustomerCustomerGroups = ChildCustomerCustomerGroupQuery::create(null, $criteria)
                    ->filterByCustomerGroup($this)
                    ->find($con);

                if (null !== $criteria) {
                    if (false !== $this->collCustomerCustomerGroupsPartial && count($collCustomerCustomerGroups)) {
                        $this->initCustomerCustomerGroups(false);

                        foreach ($collCustomerCustomerGroups as $obj) {
                            if (false == $this->collCustomerCustomerGroups->contains($obj)) {
                                $this->collCustomerCustomerGroups->append($obj);
                            }
                        }

                        $this->collCustomerCustomerGroupsPartial = true;
                    }

                    reset($collCustomerCustomerGroups);

                    return $collCustomerCustomerGroups;
                }

                if ($partial && $this->collCustomerCustomerGroups) {
                    foreach ($this->collCustomerCustomerGroups as $obj) {
                        if ($obj->isNew()) {
                            $collCustomerCustomerGroups[] = $obj;
                        }
                    }
                }

                $this->collCustomerCustomerGroups = $collCustomerCustomerGroups;
                $this->collCustomerCustomerGroupsPartial = false;
            }
        }

        return $this->collCustomerCustomerGroups;
    }
public function getCustomerCustomerGroups ( $ criteria = null , ConnectionInterface $ con = null ) { $ partial = $ this -> collCustomerCustomerGroupsPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collCustomerCustomerGroups || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collCustomerCustomerGroups ) { // return empty collection $ this -> initCustomerCustomerGroups ( ) ; } else { $ collCustomerCustomerGroups = ChildCustomerCustomerGroupQuery :: create ( null , $ criteria ) -> filterByCustomerGroup ( $ this ) -> find ( $ con ) ; if ( null !== $ criteria ) { if ( false !== $ this -> collCustomerCustomerGroupsPartial && count ( $ collCustomerCustomerGroups ) ) { $ this -> initCustomerCustomerGroups ( false ) ; foreach ( $ collCustomerCustomerGroups as $ obj ) { if ( false == $ this -> collCustomerCustomerGroups -> contains ( $ obj ) ) { $ this -> collCustomerCustomerGroups -> append ( $ obj ) ; } } $ this -> collCustomerCustomerGroupsPartial = true ; } reset ( $ collCustomerCustomerGroups ) ; return $ collCustomerCustomerGroups ; } if ( $ partial && $ this -> collCustomerCustomerGroups ) { foreach ( $ this -> collCustomerCustomerGroups as $ obj ) { if ( $ obj -> isNew ( ) ) { $ collCustomerCustomerGroups [ ] = $ obj ; } } } $ this -> collCustomerCustomerGroups = $ collCustomerCustomerGroups ; $ this -> collCustomerCustomerGroupsPartial = false ; } } return $ this -> collCustomerCustomerGroups ; }
Gets an array of ChildCustomerCustomerGroup objects which contain a foreign key that references this object.

If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called without $criteria, the cached collection is returned.
If this ChildCustomerGroup is new, it will return
an empty collection or the current collection; the criteria is ignored on a new object.

@param      Criteria $criteria optional Criteria object to narrow the query
@param      ConnectionInterface $con optional connection object
@return Collection|ChildCustomerCustomerGroup[] List of ChildCustomerCustomerGroup objects
@throws PropelException
Gets an array of ChildCustomerCustomerGroup objects which contain a foreign key that references this object .