Updated code based on Jocelyn suggestions.
This commit is contained in:
@@ -70,7 +70,7 @@ feature -- Access
|
||||
deferred
|
||||
end
|
||||
|
||||
trash_nodes (a_user_id: INTEGER_64): LIST [CMS_NODE]
|
||||
trashed_nodes (a_user_id: INTEGER_64): LIST [CMS_NODE]
|
||||
-- List of nodes by user `a_user_id'.
|
||||
deferred
|
||||
end
|
||||
@@ -148,11 +148,11 @@ feature -- Change: Node
|
||||
end
|
||||
end
|
||||
|
||||
revert_node (a_node: CMS_NODE)
|
||||
-- Revert `a_node'.
|
||||
restore_node (a_node: CMS_NODE)
|
||||
-- Restore `a_node'.
|
||||
do
|
||||
if a_node.has_id then
|
||||
revert_node_by_id (a_node.id)
|
||||
restore_node_by_id (a_node.id)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -163,8 +163,8 @@ feature -- Change: Node
|
||||
deferred
|
||||
end
|
||||
|
||||
revert_node_by_id (a_id: INTEGER_64)
|
||||
-- Revert node by id `a_id'.
|
||||
restore_node_by_id (a_id: INTEGER_64)
|
||||
-- Restore node by id `a_id'.
|
||||
require
|
||||
valid_node_id: a_id > 0
|
||||
deferred
|
||||
|
||||
@@ -41,7 +41,7 @@ feature -- Access: node
|
||||
create {ARRAYED_LIST [CMS_NODE]} Result.make (0)
|
||||
end
|
||||
|
||||
trash_nodes (a_user_id: INTEGER_64): LIST [CMS_NODE]
|
||||
trashed_nodes (a_user_id: INTEGER_64): LIST [CMS_NODE]
|
||||
-- List of nodes by user `a_user_id'.
|
||||
do
|
||||
create {ARRAYED_LIST [CMS_NODE]} Result.make (0)
|
||||
@@ -91,7 +91,7 @@ feature -- Node
|
||||
do
|
||||
end
|
||||
|
||||
revert_node_by_id (a_id: INTEGER_64)
|
||||
restore_node_by_id (a_id: INTEGER_64)
|
||||
-- <Precursor>
|
||||
do
|
||||
end
|
||||
|
||||
@@ -59,7 +59,7 @@ feature -- Access
|
||||
-- end
|
||||
end
|
||||
|
||||
trash_nodes (a_user_id: INTEGER_64): LIST [CMS_NODE]
|
||||
trashed_nodes (a_user_id: INTEGER_64): LIST [CMS_NODE]
|
||||
-- List of nodes.
|
||||
local
|
||||
l_parameters: STRING_TABLE [detachable ANY]
|
||||
@@ -203,7 +203,7 @@ feature -- Change: Node
|
||||
sql_change (sql_trash_node, l_parameters)
|
||||
end
|
||||
|
||||
revert_node_by_id (a_id: INTEGER_64)
|
||||
restore_node_by_id (a_id: INTEGER_64)
|
||||
-- <Precursor>
|
||||
local
|
||||
l_parameters: STRING_TABLE [ANY]
|
||||
@@ -217,7 +217,7 @@ feature -- Change: Node
|
||||
l_parameters.put (l_time, "changed")
|
||||
l_parameters.put ({CMS_NODE_API}.not_published, "status")
|
||||
l_parameters.put (a_id, "nid")
|
||||
sql_change (sql_revert_node, l_parameters)
|
||||
sql_change (sql_restore_node, l_parameters)
|
||||
end
|
||||
|
||||
|
||||
@@ -315,10 +315,10 @@ feature {NONE} -- Queries
|
||||
sql_delete_node: STRING = "UPDATE nodes SET changed=:changed, status =:status WHERE nid=:nid"
|
||||
-- Soft deletion with free metadata.
|
||||
|
||||
sql_trash_node: STRING = "DELETE FROM NODES WHERE nid=:nid"
|
||||
sql_trash_node: STRING = "DELETE FROM nodes WHERE nid=:nid"
|
||||
-- Physical deletion with free metadata.
|
||||
|
||||
sql_revert_node: STRING = "UPDATE nodes SET changed=:changed, status =:status WHERE nid=:nid"
|
||||
sql_restore_node: STRING = "UPDATE nodes SET changed=:changed, status =:status WHERE nid=:nid"
|
||||
-- Revert node to {CMS_NODE_API}.not_publised.
|
||||
|
||||
-- sql_update_node_author: STRING = "UPDATE nodes SET author=:author WHERE nid=:nid;"
|
||||
|
||||
Reference in New Issue
Block a user