Code Duplication    Length = 10-10 lines in 2 locations

plugins/Search/src/Engine/Generic/GenericEngine.php 1 location

@@ 444-453 (lines=10) @@
441
     * @param \Cake\Datasource\EntityInterface $entity The entity
442
     * @return string
443
     */
444
    protected function _entityId(EntityInterface $entity)
445
    {
446
        $pk = [];
447
        $keys = $this->config('pk');
448
        $keys = !is_array($keys) ? [$keys] : $keys;
449
        foreach ($keys as $key) {
450
            $pk[] = $entity->get($key);
451
        }
452
        return implode(':', $pk);
453
    }
454
455
    /**
456
     * Extracts a list of words to by indexed for given entity.

plugins/Eav/src/Model/Behavior/EavToolbox.php 1 location

@@ 204-213 (lines=10) @@
201
     * @param \Cake\Datasource\EntityInterface $entity The entity
202
     * @return string
203
     */
204
    public function getEntityId(EntityInterface $entity)
205
    {
206
        $pk = [];
207
        $keys = $this->_table->primaryKey();
208
        $keys = !is_array($keys) ? [$keys] : $keys;
209
        foreach ($keys as $key) {
210
            $pk[] = $entity->get($key);
211
        }
212
        return implode(':', $pk);
213
    }
214
215
    /**
216
     * Gets attribute's EAV type.