setters = $setters; $this->dependencies_builder = $dependencies_builder; } /** * @param string $element_type * @param int $element_id */ public function process( $element_type, $element_id ) { if ( $this->dependencies_builder ) { $dependencies_tree = $this->dependencies_builder->from( $element_type, $element_id ); while ( ! $dependencies_tree->iteration_completed() ) { $node = $dependencies_tree->get_next(); $this->setters[ $node->get_type() ]->process( $node->get_id() ); $node->detach(); } } elseif ( 'post' === $element_type ) { $this->setters['post']->process( $element_id ); } } }