Skip to content

Instantly share code, notes, and snippets.

@smarek smarek/assoc.php
Created Aug 26, 2019

What would you like to do?
cakephp remove all associated fields from entity
public function entityStripAssociations(Entity &$entity)
/** @var Table $table */
$table = TableRegistry::getTableLocator()->get($entity->getSource());
foreach ($table->associations() as $asoc) {
return $entity;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.