src/Model/Behavior/SlugBehavior.php
protected function _conditions($entity, $slug)
    {
        /** @var string $primaryKey */
        $primaryKey = $this->_table->getPrimaryKey();
        $field = $this->_table->aliasField($this->getConfig('field'));

        $conditions = [$field => $slug];

        if (is_callable($this->getConfig('scope'))) {
            $scope = $this->getConfig('scope');
            $conditions += $scope($entity);
        } else {
            $conditions += $this->getConfig('scope');
        }

        if ($id = $entity->{$primaryKey}) {
            $conditions['NOT'][$this->_table->aliasField($primaryKey)] = $id;
        }

        return $conditions;
    }
protected function _conditions($entity, $slug)
    {
        /** @var string $primaryKey */
        $primaryKey = $this->_table->getPrimaryKey();
        $field = $this->_table->aliasField($this->getConfig('field'));

        $conditions = [$field => $slug];

        if (is_callable($this->getConfig('scope'))) {
            $scope = $this->getConfig('scope');
            $conditions += $scope($entity);
        } else {
            $conditions += $this->getConfig('scope');
        }

        if ($id = $entity->{$primaryKey}) {
            $conditions['NOT'][$this->_table->aliasField($primaryKey)] = $id;
        }

        return $conditions;
    }
protected function _conditions ( $ entity , $ slug ) { /** @var string $primaryKey */ $ primaryKey = $ this -> _table -> getPrimaryKey ( ) ; $ field = $ this -> _table -> aliasField ( $ this -> getConfig ( 'field' ) ) ; $ conditions = [ $ field => $ slug ] ; if ( is_callable ( $ this -> getConfig ( 'scope' ) ) ) { $ scope = $ this -> getConfig ( 'scope' ) ; $ conditions += $ scope ( $ entity ) ; } else { $ conditions += $ this -> getConfig ( 'scope' ) ; } if ( $ id = $ entity -> { $ primaryKey } ) { $ conditions [ 'NOT' ] [ $ this -> _table -> aliasField ( $ primaryKey ) ] = $ id ; } return $ conditions ; }
Builds the conditions

@param \Cake\ORM\Entity $entity Entity.
@param string $slug Slug
@return array
Builds the conditions