How to write a DELETE FROM table WHERE id = 2 query in doctrine2 in Zend?
DELETE FROM table WHERE id = 2
$this->_em->getrepository(something\entitity\something\table)->remove()->where('id',2) ?
$repository = $this->_em->getRepository('My\\Entity'); $query = $repository->createQuery('DELETE FROM entity e WHERE e.id = ?1'); $query->setParameter(1, $id); $query->execute();
Source: https://habr.com/ru/post/947610/More articles:The subtle difference between sorting and sort_by - sortingHow to uniformly initialize a unique_ptr map? - c ++R, ggplot2, plot size - rreactive variable to capture user input (Meteor) - javascriptAny GC.disable performance flaws? - optimizationC # compiler convert and save static variables? - compiler-constructionUnderstanding the static storage class in C - cHow does Application.Restart work in .NET? - c #Error getting lock (org.neo4j.kernal.StoreLockException) - java-eeHow to store values ββin onSaveInstanceState () and retrieve? - androidAll Articles