I started an app with CakePHP3 and i need to record some users\'s actions. So, I have migrated my log structure, I have baked my controller & model and now, I try to get
This way
use Cake\ORM\TableRegistry;
$logs = TableRegistry::get('LogsTable');
$logs->save($log);
more info
EDIT since 3.6 you should use
use Cake\ORM\TableLocator
$articles = TableRegistry::getTableLocator()->get('Articles', [
'className' => 'App\Custom\ArticlesTable',
'table' => 'my_articles',
'connection' => $connectionObject,
'schema' => $schemaObject,
'entityClass' => 'Custom\EntityClass',
'eventManager' => $eventManager,
'behaviors' => $behaviorRegistry
]);
more info here