RSS Feed/News Bulk delete from database with entity framework

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,762
Points
823

Reputation:

How do I delete rows from a database using entity framework.

For example, I could use the following query today:
Code:

$db->query('DELETE FROM mytable WHERE timestamp > ?', [$timestamp]);

But I was trying to use the entity framework, but doesn't seem like delete is an option?
Code:

\XF::finder('myaddon:myentity')->where('timestamp', '>', $timestamp)->delete();

Thank you!

Continue reading...
 
Status
Not open for further replies.
Top