GridHandler::getRequestedRow PHP Méthode

getRequestedRow() public méthode

Raises a fatal error if such an element cannot be found.
public getRequestedRow ( $request, $args ) : GridRow
$request PKPRequest
$args array
Résultat GridRow the requested grid row, already configured with id and data or null if the row could not been found.
    function getRequestedRow($request, $args)
    {
        $isModified = isset($args['modify']);
        if (isset($args['rowId']) && !$isModified) {
            // A row ID was specified. Fetch it
            $elementId = $args['rowId'];
            // Retrieve row data for the requested row id
            $dataElement = $this->getRowDataElement($request, $elementId);
            if (is_null($dataElement)) {
                // If the row doesn't exist then
                // return null. It may be that the
                // row has been deleted in the meantime
                // and the client does not yet know about this.
                $nullVar = null;
                return $nullVar;
            }
        } elseif ($isModified) {
            $elementId = null;
            // The row is modified. The client may be asking
            // for a formatted new entry, to be saved later, or
            // for a representation of a modified row.
            $dataElement = $this->getRowDataElement($request, $elementId);
            if (isset($args['rowId'])) {
                // the rowId holds the elementId being modified
                $elementId = $args['rowId'];
            }
        }
        // Instantiate a new row
        return $this->_getInitializedRowInstance($request, $elementId, $dataElement, $isModified);
    }