Gets the item edit page / information.

@param string $modelName
@param mixed  $itemId
514641
public function item($modelName, $itemId = 0)
    {
        $config            = app('itemconfig');
        $fieldFactory      = app('admin_field_factory');
        $actionFactory     = app('admin_action_factory');
        $columnFactory     = app('admin_column_factory');
        $actionPermissions = $actionFactory->getActionPermissions();
        $fields            = $fieldFactory->getEditFields();

        //if it's ajax, we just return the item information as json
        if ($this->request->ajax()) {
            //try to get the object
            $model = $config->getModel($itemId, $fields, $columnFactory->getIncludedColumns($fields));

            if ($model->exists) {
                $model = $config->updateModel($model, $fieldFactory, $actionFactory);
            }

            $response = $actionPermissions['view'] ? response()->json($model) : response()->json(array(
                'success' => false,
                'errors'  => 'You do not have permission to view this item',
            ));

            //set the Vary : Accept header to avoid the browser caching the json response
            return $response->header('Vary', 'Accept');
        } else {
            $view = view('administrator::index', array(
                'itemId' => $itemId,
            ));

            //set the layout content and title
            $this->layout->content = $view;

            return $this->layout;
        }
    }
1283684
public function save($modelName, $id = null)
    {
        // Custom page_type
        $this->request->merge([
            'pagetype' => ".blade.php",
        ]);

        return parent::save($modelName, $id);
    }
475503
public static function update_inplace_editable($component, $itemtype, $itemid, $value) {
        global $PAGE;
        // Validate and normalize parameters.
        $params = self::validate_parameters(self::update_inplace_editable_parameters(),
                      array('component' => $component, 'itemtype' => $itemtype, 'itemid' => $itemid, 'value' => $value));
        if (!$functionname = component_callback_exists($component, 'inplace_editable')) {
            throw new \moodle_exception('inplaceeditableerror');
        }
        $tmpl = component_callback($params['component'], 'inplace_editable',
            array($params['itemtype'], $params['itemid'], $params['value']));
        if (!$tmpl || !($tmpl instanceof \core\output\inplace_editable)) {
            throw new \moodle_exception('inplaceeditableerror');
        }
        return $tmpl->export_for_template($PAGE->get_renderer('core'));
    }
843825
public function deleteVersionById(string $modelId, string $versionId)
    {
        $deleteResult = $this->getRequest()->request(
            'DELETE',
            $this->getRequestUrl(sprintf('models/%s/versions/%s', $modelId, $versionId))
        );

        return $deleteResult['status'];
    }
164456
public function getItemById(string $itemId, bool $getChildren = false):array
    {
        $parameters = $getChildren === true ? '$expand=Children' : '';

        return $this->get("Items({$itemId})?{$parameters}");
    }
1083957
protected function get_mapping($itemname, $itemid) {
        // Check restoreid is set
        if (!$this->restoreid) {
            throw new restore_decode_rule_exception('decode_rule_restoreid_not_set');
        }
        if (!$found = restore_dbops::get_backup_ids_record($this->restoreid, $itemname, $itemid)) {
            return false;
        }
        return $found->newitemid;
    }
673674
private function loadPvForQuoteItem($itemId)
    {
        if (!isset($this->cachePvQuoteItem[$itemId])) {
            $found = $this->daoPvQuoteItem->getById((int)$itemId);
            $this->cachePvQuoteItem[$itemId] = $found;
        }
        return $this->cachePvQuoteItem[$itemId];
    }
217422
public function getDocument($messageId, $entityId)
    {
        return $this->diadocApi->getDocument($this->boxId, $messageId, $entityId);
    }
215708
public CmsTreeItem getChild(String itemId) {

        CmsTreeItem result = m_children.getItem(itemId);
        return result;
    }
962964
public function get_new_parentid($itemname) {
        return array_key_exists($itemname, $this->elementsnewid) ? $this->elementsnewid[$itemname] : null;
    }
966292
public function get_old_parentid($itemname) {
        return array_key_exists($itemname, $this->elementsoldid) ? $this->elementsoldid[$itemname] : null;
    }
11582
public static function getLikeViewData($itemId)
    {
		$totalCount = TotalLike::where('item_id', $itemId)->first();
		if($totalCount == NULL) {
			$totalCount = new TotalLike;
			$totalCount->item_id = $itemId;
			$totalCount->total_like = 0;
			$totalCount->total_dislike = 0;

			$totalCount->save();
		}

		$yourVote = 0; // 0 = Not voted, 1 = Liked, -1 = Disliked
		if (Auth::check()) {
			$checkYourVote = \risul\LaravelLikeComment\Models\Like::where([
																	'user_id' => Auth::user()->id,
																	'item_id' => $itemId
																	])->first();
			if ($checkYourVote != NULL) {
				$yourVote = $checkYourVote->vote;
			}
		}

		$likeDisabled = "";
		if (!Auth::check()) {
			$likeDisabled = "disabled";
		}

		$likeIconOutlined = $yourVote == 1 ? "" : "outline";
		$dislikeIconOutlined = $yourVote == -1 ? "" : "outline";

		return [
			$itemId.'likeDisabled' => $likeDisabled,
			$itemId.'likeIconOutlined' => $likeIconOutlined,
			$itemId.'dislikeIconOutlined' => $dislikeIconOutlined,
			$itemId.'total_like' => $totalCount->total_like,
			$itemId.'total_dislike' => $totalCount->total_dislike,
		];
    }
1043341
public function getSubItems($itemType, $id, $subItem, array $queryString = []) {
      $options = [];
      if ($queryString) {
         $options['query'] = $queryString;
      }
      $response = $this->client->request('get', $itemType . '/' . $id . '/' . $subItem,
         $options);
      $contentRange = $response->getHeader('Content-Range');
      $acceptRange = $response->getHeader('Accept-Range');
      return [
         'statusCode' => $response->getStatusCode(),
         'body' => $response->getBody()->getContents(),
         'contentRange' => ($contentRange) ? $contentRange[0] : null,
         'acceptRange' => ($acceptRange) ? $acceptRange[0] : null,
      ];
   }
392097
public function edit($id)
    {
        // Get the model instance
        $item = $this->findOrFail($id);

        // Respond to AJAX requests for a single item with JSON
        if (Request::ajax()) {
            return Response::json($item);
        }

        // Look for overriden views
        $this->overrideViews();

        // Populate form
        Former::populate($item);
        Former::withRules($this->getRules());

        // Initialize localization
        with($localize = new Localize)
            ->item($item)
            ->title(Str::singular($this->title));

        // Make the sidebar
        $sidebar = new Sidebar($item);
        if (!$localize->hidden()) {
            $sidebar->addToEnd($localize);
        }

        // Render view
        return $this->populateView($this->show_view, [
            'item' => $item,
            'localize' => $localize,
            'sidebar' => $sidebar,
            'parent_id' => $this->parent ? $this->parent->getKey() : null,
        ]);
    }
381140
private function verifyItemExistenceInSubItemList(string $itemName, string $itemType, string $containerName, bool $itemShouldExist): void
    {
        $isItemInTable = PageObjectFactory::createPage($this->utilityContext, ContentItemPage::PAGE_NAME, $containerName)
            ->subItemList->table->isElementInTable($itemName, $itemType);

        $itemShouldExistString = $itemShouldExist ? '' : 'n\'t';

        if ($isItemInTable !== $itemShouldExist) {
            Assert::fail(sprintf('%s "%s" should%s be on %s Sub-items list', $itemType, $itemName, $itemShouldExistString, $containerName));
        }
    }
214316
public function getItem($itemId, $data = null)
	{
		$params = $this->setUpParams('item', $itemId, $data, 'itemListData', 'itemData');
		$array  = $this->makeRequest('item', $itemId, $params);

		if ($this->appendId($itemId))
		{
			return new staticItem($array);
		}
		else
		{
			return new ItemList($array);
		}
	}
233945
public function updateOptions($modelName)
    {
        $fieldFactory = app('admin_field_factory');
        $response     = array();

        //iterate over the supplied constrained fields
        foreach ($this->request->input('fields', array()) as $field) {
            //get the constraints, the search term, and the currently-selected items
            $constraints   = array_get($field, 'constraints', array());
            $term          = array_get($field, 'term', array());
            $type          = array_get($field, 'type', false);
            $fieldName     = array_get($field, 'field', false);
            $selectedItems = array_get($field, 'selectedItems', false);

            $response[$fieldName] = $fieldFactory->updateRelationshipOptions($fieldName, $type, $constraints, $selectedItems, $term);
        }

        return response()->json($response);
    }