Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 448-457 (lines=10) @@
445
     * @param \Cake\Datasource\EntityInterface $entity The entity
446
     * @return string
447
     */
448
    protected function _entityId(EntityInterface $entity)
449
    {
450
        $pk = [];
451
        $keys = $this->config('pk');
452
        $keys = !is_array($keys) ? [$keys] : $keys;
453
        foreach ($keys as $key) {
454
            $pk[] = $entity->get($key);
455
        }
456
457
        return implode(':', $pk);
458
    }
459
460
    /**

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

@@ 245-254 (lines=10) @@
242
     * @param \Cake\Datasource\EntityInterface $entity The entity
243
     * @return string
244
     */
245
    public function getEntityId(EntityInterface $entity)
246
    {
247
        $pk = [];
248
        $keys = $this->_table->primaryKey();
249
        $keys = !is_array($keys) ? [$keys] : $keys;
250
        foreach ($keys as $key) {
251
            $pk[] = $entity->get($key);
252
        }
253
        return implode(':', $pk);
254
    }
255
256
    /**
257
     * Gets attribute's EAV type.