public function addAssociationPath(string $path): self
    {
        $parts = explode('.', $path);

        $criteria = $this;
        foreach ($parts as $part) {
            if (!$criteria->hasAssociation($part)) {
                $criteria->addAssociation($part);
            }

            $criteria = $criteria->getAssociation($part);
        }

        return $this;
    }
public function addAssociationPath(string $path): self
    {
        $parts = explode('.', $path);

        $criteria = $this;
        foreach ($parts as $part) {
            if (!$criteria->hasAssociation($part)) {
                $criteria->addAssociation($part);
            }

            $criteria = $criteria->getAssociation($part);
        }

        return $this;
    }
public function addAssociationPath ( string $ path ) : self { $ parts = explode ( '.' , $ path ) ; $ criteria = $ this ; foreach ( $ parts as $ part ) { if ( ! $ criteria -> hasAssociation ( $ part ) ) { $ criteria -> addAssociation ( $ part ) ; } $ criteria = $ criteria -> getAssociation ( $ part ) ; } return $ this ; }
Allows to add a nested association
Allows to add a nested association