public function getEntityId(EntityInterface $entity)
    {
        $pk = [];
        $keys = $this->_table->primaryKey();
        $keys = !is_array($keys) ? [$keys] : $keys;
        foreach ($keys as $key) {
            $pk[] = $entity->get($key);
        }

        return implode(':', $pk);
    }
public function getEntityId(EntityInterface $entity)
    {
        $pk = [];
        $keys = $this->_table->primaryKey();
        $keys = !is_array($keys) ? [$keys] : $keys;
        foreach ($keys as $key) {
            $pk[] = $entity->get($key);
        }

        return implode(':', $pk);
    }
public function getEntityId ( EntityInterface $ entity ) { $ pk = [ ] ; $ keys = $ this -> _table -> primaryKey ( ) ; $ keys = ! is_array ( $ keys ) ? [ $ keys ] : $ keys ; foreach ( $ keys as $ key ) { $ pk [ ] = $ entity -> get ( $ key ) ; } return implode ( ':' , $ pk ) ; }
Calculates entity's primary key.

If PK is composed of multiple columns they will be merged with `:` symbol.
For example, consider `Users` table with composed PK <nick, email>, then for
certain User entity this method could return:

john-locke:john@the-island.com

@param \Cake\Datasource\EntityInterface $entity The entity
@return string
Calculates entity s primary key .