Jarves\Admin\ObjectCrud::getItem PHP Method

getItem() public method

If one primary key: array( 'id' => 1234 ) If multiple primary keys: array( 'id' => 1234 'secondId' => 5678 )
public getItem ( array $pk, array $fields = null, boolean $withAcl = false ) : array
$pk array
$fields array
$withAcl boolean
return array
    public function getItem($pk, $fields = null, $withAcl = false)
    {
        $storageController = $this->objects->getStorageController($this->getObject());
        $pk = $storageController->normalizePrimaryKey($pk);
        $this->primaryKey = $pk;
        $aclRequest = ACLRequest::create($this->getObject(), $pk)->onlyViewMode();
        if ($this->getPermissionCheck() && !$this->acl->check($aclRequest)) {
            return null;
        }
        $options['fields'] = $this->getItemSelection($fields);
        $item = $storageController->getItem($pk, $options);
        //check against additionally our own custom condition
        if ($item && ($condition = $this->getCondition()) && $condition->hasRules()) {
            if (!$this->conditionOperator->satisfy($condition, $item, $this->getObject())) {
                $item = null;
            }
        }
        if ($limitDataSets = $this->getObjectDefinition()->getLimitDataSets()) {
            if (!$this->conditionOperator->satisfy($limitDataSets, $item, $this->getObject())) {
                return null;
            }
        }
        if ($item && $withAcl) {
            $this->prepareRow($item);
            $this->prepareFieldAcl($item);
        }
        return $item;
    }
ObjectCrud