protected function _getFinder($assocPath = null)
    {
        $finders = $this->getConfig('finder');

        if (!is_array($finders)) {
            $finders = [$finders];
        }

        // for backward compatibility
        if ($this->getConfig('includeTranslations')) {
            $finders[] = 'translations';
        }

        if ($finders === ['all']) {
            return $finders;
        }

        $object = $this->_table;
        if ($assocPath) {
            $parts = explode('.', $assocPath);
            foreach ($parts as $prop) {
                $object = $object->{$prop};
            }
        }

        $tmp = [];
        foreach ($finders as $finder) {
            if ($object->hasFinder($finder)) {
                $tmp[] = $finder;
            }
        }

        if (empty($tmp)) {
            $tmp = ['all'];
        }

        $finders = array_unique($tmp);

        return $finders;
    }
protected function _getFinder($assocPath = null)
    {
        $finders = $this->getConfig('finder');

        if (!is_array($finders)) {
            $finders = [$finders];
        }

        // for backward compatibility
        if ($this->getConfig('includeTranslations')) {
            $finders[] = 'translations';
        }

        if ($finders === ['all']) {
            return $finders;
        }

        $object = $this->_table;
        if ($assocPath) {
            $parts = explode('.', $assocPath);
            foreach ($parts as $prop) {
                $object = $object->{$prop};
            }
        }

        $tmp = [];
        foreach ($finders as $finder) {
            if ($object->hasFinder($finder)) {
                $tmp[] = $finder;
            }
        }

        if (empty($tmp)) {
            $tmp = ['all'];
        }

        $finders = array_unique($tmp);

        return $finders;
    }
protected function _getFinder ( $ assocPath = null ) { $ finders = $ this -> getConfig ( 'finder' ) ; if ( ! is_array ( $ finders ) ) { $ finders = [ $ finders ] ; } // for backward compatibility if ( $ this -> getConfig ( 'includeTranslations' ) ) { $ finders [ ] = 'translations' ; } if ( $ finders === [ 'all' ] ) { return $ finders ; } $ object = $ this -> _table ; if ( $ assocPath ) { $ parts = explode ( '.' , $ assocPath ) ; foreach ( $ parts as $ prop ) { $ object = $ object -> { $ prop } ; } } $ tmp = [ ] ; foreach ( $ finders as $ finder ) { if ( $ object -> hasFinder ( $ finder ) ) { $ tmp [ ] = $ finder ; } } if ( empty ( $ tmp ) ) { $ tmp = [ 'all' ] ; } $ finders = array_unique ( $ tmp ) ; return $ finders ; }
Return finder to use for fetching entities.

@param string|null $assocPath Dot separated association path. E.g. Invoices.InvoiceItems
@return string
Return finder to use for fetching entities .