File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,22 +95,19 @@ public function get(int $id): ExtraFluent
9595
9696
9797 /**
98- * Delete a record by a specific column or by primary key if column is not provided .
98+ * Delete a record by a specific column value .
9999 *
100- * @param mixed $target Column name or value for primary key .
101- * @param mixed|null $args Value to match (ignored if only primary key is used) .
100+ * @param string $column The column name to search by .
101+ * @param mixed $args The value to match against the column .
102102 * @return ExtraFluent The fluent query builder for deleting the record.
103- * @throws AttributeDetectionException If table or class is not defined.
103+ * @throws AttributeDetectionException If the table name or class is not defined.
104104 */
105- public function delete (mixed $ target , mixed $ args = null ): ExtraFluent
105+ public function delete (string $ column , mixed $ args ): ExtraFluent
106106 {
107- $ column = $ args === null ? $ this ->getPrimaryKey () : $ target ;
108- $ value = $ args ?? $ target ;
109-
110107 return $ this ->command ()
111108 ->delete ()
112109 ->from ($ this ->getTableName ())
113- ->where ('%n = ? ' , $ column , $ value );
110+ ->where ('%n = ? ' , $ column , $ args );
114111 }
115112
116113
You can’t perform that action at this time.
0 commit comments