Obtain scope of the row from row data.

@param array $rowData
@return int
500379
public function getRowScope(array $rowData)
    {
        if (isset($rowData[self::COL_CATEGORY]) && strlen(trim($rowData[self::COL_CATEGORY]))) {
            return self::SCOPE_DEFAULT;
        } elseif (empty($rowData[self::COL_STORE])) {
            return self::SCOPE_NULL;
        } else {
            return self::SCOPE_STORE;
        }
    }
1332547
public function &Row($RowIndex) {
		$Result = &$this->Result();
      if(isset($Result[$RowIndex]))
			return $Result[$RowIndex];
      return $this->_EOF;
   }
471242
function &GetArrayLimit($nrows,$offset=-1)
  {
    if ($offset <= 0) {
      $rs =& $this->GetArray($nrows);
      return $rs;
    }
    $savem = $this->fetchMode;
    $this->fetchMode = ADODB_FETCH_NUM;
    $this->Move($offset);
    $this->fetchMode = $savem;

    if ($this->fetchMode & ADODB_FETCH_ASSOC) {
      $this->fields =& $this->GetRowAssoc();
    }

    $results = array();
    $cnt = 0;
    while (!$this->EOF && $nrows != $cnt) {
      $results[$cnt++] = $this->fields;
      $this->MoveNext();
    }

    return $results;
  }
85547
public function getRowStyle(array $row_data): string
    {
        if ($this->ajax || (isset($row_data[$this->pid_column]) && (string)$row_data[$this->pid_column] === $this->_top_level_id)) {
            return '';
        }

        return 'display: none;';
    }
509203
public function calculateFieldInfo($currentValue, array $fieldData)
    {
        if (! $currentValue) {
            return $currentValue;
        }

        // Display nice
        $sql = $this->_sql . "WHERE grr_id = ?";
        $row = $this->db->fetchRow($sql, $currentValue);

        if ($row && isset($row['name'])) {
            return $row['name'];
        }

        return $currentValue;
    }
109369
private function getRow($row_number, array $row)
    {
        $message = '';
        foreach ($row as $cell_number => $player) {
            $withBackground = $this->drawCellBackground($row_number, $cell_number);
            $message .= ($withBackground ? "|<bg={$this->background_color}> " : '| ')
                        . $this->getPlayerChar($player, $withBackground)
                        . ($withBackground ? " </bg={$this->background_color}>" : ' ')
            ;
        }
        $message .= "|\n";
        $message .= $this->getLineSeparator();

        return $message;
    }
1050156
public function getNumRows($cursor = null)
    {
        $this->connect();

        if ($cursor instanceof Statement) {
            return $cursor->rowCount();
        } elseif ($this->prepared instanceof Statement) {
            return $this->prepared->rowCount();
        } else {
            return 0;
        }
    }
932182
protected static function _createInnerIterator(DatabaseRowsetInterface $rowset)
    {
        $iterator = new \RecursiveArrayIterator($rowset->getIterator());
        $iterator = new \RecursiveCachingIterator($iterator, \CachingIterator::TOSTRING_USE_KEY);

        return $iterator;
    }
1208464
protected function isSurpassingFileSizeLimit($stringData)
    {
        $expectedFileSize = $this->accommulatedFileSize + $this->getStringSize($stringData);

        return $this->maxFilesize < $expectedFileSize;
    }
335503
public function getAt(): int
    {
        if ($this->at < 0) {
            return Location::BeforeFirstRow;
        }

        if ($this->at > $this->rowCount()) {
            return Location::AfterLastRow;
        }

        return $this->at;
    }
904504
public function rowCount(): int
    {
        if (!$this->wasExecuted()) {
            $this->exec();
        }

        return $this->getAdapter()->getStatement()->rowCount();
    }
274894
public function getTotalSelectedRowsWithoutLimit(): int
    {
        if (!$this->require_to_count_total_rows) {
            dump('You need to call setRequireCountRowsWithoutLimits(true) before requesting result');
        }

        $this->collectObjects();

        return (int)$this->total_count_rows;
    }
553192
public function getValue($rowId, $columnId, $data = null)
    {
        $returnValue = null;

        
		if(isset($this->data[$rowId]) && is_a($this->data[$rowId], 'wfEngine_helpers_Monitoring_ActivityMonitoringGrid')){
			
			$returnValue = $this->data[$rowId];
		}
		else{
			
			$subgridData = $this->getSubgridRows($rowId);
			$cloneSubGridCtn = clone $this->subGridContainer;
			$cloneSubGridCtn->getGrid()->setData($subgridData);
			$returnValue = $cloneSubGridCtn;
			$this->data[$rowId] = $cloneSubGridCtn;
		}
        

        return $returnValue;
    }
805348
public function getRowCount()
    {
        $this->parseDefer();
        if(!$this->isSuccess)
        {
            throw new \RuntimeException('Result is not success!');
        }
        return count($this->statement->fetchAll());
    }
972505
public function validateRow(array $rowData, $rowNum)
    {
        static $root = null;
        static $category = null;

        if (isset($rowData['fsi_line_number'])) {
            $rowNum = $rowData['fsi_line_number'];
        }
        $this->filterRowData($rowData);

        // check if row is already validated
        if (isset($this->_validatedRows[$rowNum])) {
            return !isset($this->invalidRows[$rowNum]);
        }
        $this->_validatedRows[$rowNum] = true;


        //check for duplicates
        if (isset($rowData[self::COL_ROOT])
            && isset($rowData[self::COL_CATEGORY])
            && isset($this->newCategory[$rowData[self::COL_ROOT]][$rowData[self::COL_CATEGORY]])
        ) {
            if (!$this->getIgnoreDuplicates()) {
                $this->addRowError(self::ERROR_DUPLICATE_CATEGORY, $rowNum);
            }

            return false;
        }
        $rowScope = $this->getRowScope($rowData);

        // BEHAVIOR_DELETE use specific validation logic
        if (Import::BEHAVIOR_DELETE == $this->getBehavior()) {
            if (self::SCOPE_DEFAULT == $rowScope
                && !isset($this->categoriesWithRoots[$rowData[self::COL_ROOT]][$rowData[self::COL_CATEGORY]])
            ) {
                $this->addRowError(self::ERROR_CATEGORY_NOT_FOUND_FOR_DELETE, $rowNum);
                return false;
            }
            return true;
        }

        // common validation
        if (self::SCOPE_DEFAULT == $rowScope) { // category is specified, row is SCOPE_DEFAULT, new category block begins
            $rowData[CategoryModel::KEY_NAME] = $this->getCategoryName($rowData);

            $this->_processedEntitiesCount++;

            $root = $rowData[self::COL_ROOT];
            $category = $rowData[self::COL_CATEGORY];

            //check if the root exists
            if (!isset($this->categoriesWithRoots[$root])) {
                $this->addRowError(self::ERROR_INVALID_ROOT, $rowNum);
                return false;
            }

            //check if parent category exists
            if ($this->getParentCategory($rowData) === false) {

                $this->addRowError(self::ERROR_PARENT_NOT_FOUND, $rowNum);
                return false;
            }

            if (isset($this->categoriesWithRoots[$root][$category])) {

            } else { // validate new category type and attribute set
                if (!isset($this->newCategory[$root][$category])) {
                    $this->newCategory[$root][$category] = ['entity_id' => null];
                }
                if (isset($this->invalidRows[$rowNum])) {
                    // mark SCOPE_DEFAULT row as invalid for future child rows if category not in DB already
                    $category = false;
                }
            }

            // check simple attributes
            foreach ($this->attributes as $attrCode => $attrParams) {
                if (isset($rowData[$attrCode]) && strlen($rowData[$attrCode])) {
                    $this->isAttributeValid($attrCode, $attrParams, $rowData, $rowNum);
                } elseif ($attrParams['is_required'] && !isset($this->categoriesWithRoots[$root][$category])) {
                    $this->addRowError(self::ERROR_VALUE_IS_REQUIRED, $rowNum, $attrCode);
                }
            }

        } else {
            if (null === $category) {
                $this->addRowError(self::ERROR_CATEGORY_IS_EMPTY, $rowNum);
            } elseif (false === $category) {
                $this->addRowError(self::ERROR_ROW_IS_ORPHAN, $rowNum);
            } elseif (self::SCOPE_STORE == $rowScope && !isset($this->storeCodeToId[$rowData[self::COL_STORE]])) {
                $this->addRowError(self::ERROR_INVALID_STORE, $rowNum);
            }
        }

        if (isset($this->invalidRows[$rowNum])) {
            $category = false; // mark row as invalid for next address rows
        }

        return !isset($this->invalidRows[$rowNum]);
    }
663430
protected function dereferenceArray(array &$arrayData)
    {
        try {
            foreach ($arrayData as $idx => $data) {
                // go deeper if is array
                if (is_array($data)) {
                    $this->dereferenceArray($arrayData[$idx]);

                // dereference if it is a reference #changed
                } elseif (false !== ($ref = $this->isReference($data))) {
                    $arrayData[$idx] = $this->getReferenceValue($ref);
                }
            }
        } catch (\Exception $e) {
            throw new LogicException($e->getMessage(), $e->getCode(), $e);
        }
    }
1338386
public function setDbDataFromRow(array $rowData)
    {
        // If there are less row data than properties, use rows as starting point (optimization)
        if (count($rowData) < count(static::$dbProperties)) {
            foreach ($rowData as $dbFieldName => $value) {
                $propertyName = static::getDbPropertyName($dbFieldName);
                if (isset(static::$dbProperties[$propertyName])) {
                    $this->setDbValue($propertyName, $value, false);
                }
            }
        // If there are more row data than properties, use properties as starting point
        } else {
            foreach (array_keys(static::$dbProperties) as $propertyName) {
                $fieldName = static::getDbFieldName($propertyName);
                if (array_key_exists($fieldName, $rowData)) {
                    $this->setDbValue($propertyName, $rowData[$fieldName], false);
                }
            }
        }

        $this->updatePrimaryDbValueFromDbData();
    }