/** * Determine which action should be done with the given node * * @param NodeInterface $node * @param Context $context * @param LoaderInterface $loader * * @return string * One of the \USync\Loading\Loader::LOAD_* constant */ protected function getLoadMode(NodeInterface $node, Context $context, LoaderInterface $loader) { if ($node instanceof DeleteNode || $node instanceof NullValueNode) { $mode = self::LOAD_DELETE; } else { if ($node instanceof DefaultNode) { $mode = self::LOAD_SYNC; } else { if ($node instanceof BooleanValueNode) { if ($node->getValue()) { $mode = self::LOAD_SYNC; } else { $mode = self::LOAD_DELETE; } } else { if ($node instanceof DrupalNodeInterface && $node->shouldIgnore()) { $mode = self::LOAD_IGNORE; } else { if ($node instanceof DrupalNodeInterface && $node->shouldDelete()) { $mode = self::LOAD_DELETE; } else { $mode = self::LOAD_SYNC; } } } } } return $mode; }