Skip to content

Commit

Permalink
Implement RecursiveHierarchyDisallowed exception
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhicks committed Dec 18, 2011
1 parent 27a42a8 commit 35dfe49
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion application/core/project_hierarchy_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* @uses database_api.php
*/

use MantisBT\Exception\Project\RecursiveHierarchyDisallowed;

require_api( 'constant_inc.php' );
require_api( 'database_api.php' );

Expand All @@ -44,7 +46,7 @@
*/
function project_hierarchy_add( $p_child_id, $p_parent_id, $p_inherit_parent = true ) {
if( in_array( $p_parent_id, project_hierarchy_get_all_subprojects( $p_child_id ) ) ) {
trigger_error( ERROR_PROJECT_RECURSIVE_HIERARCHY, ERROR );
throw new RecursiveHierarchyDisallowed( $p_parent_id, $p_child_id );
}

$c_child_id = db_prepare_int( $p_child_id );
Expand Down

0 comments on commit 35dfe49

Please sign in to comment.