Populates an auth item with the data fetched from collection
@param array $row the data from the auth item collection
@return Item the populated auth item instance (either Role or Permission)
483431
protected function populateItem($row)
    {
        $class = $row['type'] == Item::TYPE_PERMISSION ? Permission::className() : Role::className();

        if (!isset($row['data']) || ($data = @unserialize($row['data'])) === false) {
            $data = null;
        }

        return new $class([
            'name' => $row['name'],
            'type' => $row['type'],
            'description' => $row['description'],
            'ruleName' => $row['rule_name'],
            'data' => $data,
            'createdAt' => $row['created_at'],
            'updatedAt' => $row['updated_at'],
            'parents' => isset($row['parents']) ? $row['parents'] : null,
        ]);
    }
278683
protected function pdoResultToArray($row)
    {
        if (is_object($row)) {
            $row = (array)$row;
        }

        $data = [];

        foreach ($row as $key=>$value) {
            if (!is_numeric($key)) {
                $data[$key] = $value;
            }
        }

        return $data;
    }
1191653
protected function _createInstanceFromRow($row)
        {
            $instance = self::for_table($this->_table_name, $this->_connection_name);
            $instance->use_id_column($this->_instance_id_column);
            $instance->hydrate($row);

            return $instance;
        }
318402
public function reset( $row = null ) {

		$row = pods_absint( $row );

		$this->row = false;

		if ( isset( $this->data[ $row ] ) ) {
			$this->row = get_object_vars( $this->data[ $row ] );
		}

		if ( empty( $row ) ) {
			$this->row_number = - 1;
		} else {
			$this->row_number = $row - 1;
		}

		return $this->row;
	}
664963
protected function findTokenFor(array $row)
    {
        if (isset($row['token']) && $row['token']) {
            return $this->tokenLibrary->filter($row['token']);
        }

        return null;
    }
30272
private function resolvePermissions(Row $row, UserInterface $user = null)
    {
        $permissions = [];
        if (null !== $user) {
            foreach ($user->getRoleObjects() as $role) {
                foreach (array_filter(explode(' ', $row->getValue(sprintf('role%s', $role->getId())))) as $permission) {
                    $permissions[$role->getId()][$permission] = true;
                }
            }
        }

        return $permissions;
    }
956772
private function extractUserPreferenceFromRow(array $row): UserPreference
    {
        $userPreference = new UserPreference();
        $userPreference->id = (int)$row['id'];
        $userPreference->userId = (int)$row['user_id'];
        $userPreference->name = $row['name'];
        $userPreference->value = $row['value'];

        return $userPreference;
    }
682961
public function getPersistedEntityFor(Row $row)
    {
        $entityInstanceHash = array_search($row, $this->persistedEntityRows, true);

        if (!$entityInstanceHash) {
            return null;
        }

        return $this->persistedEntities[$entityInstanceHash];
    }
93931
public function fillItems(array &$rows = null)
    {
        if ($rows === null) {
            return $this->load();
        }

        $this->clearItems();
        foreach ($rows as $row) {
            $item = $this->instantiateItem($row);
            $this->addItem($item);
        }

        return true;
    }
70063
public function process(array $row)
    {
        foreach ($row as &$item) {
            if ($item instanceof DateTimeInterface) {
                $item = $item->format($this->format);
            }
        }

        return $row;
    }
563138
public function map($row){
        $class = $this->modelClass;
        $model = new $class($this->db, $row, false);
        $model->setAttribute('table', $this->table)->setAttribute('pk', $this->pk);
        return $model;
    }
161126
protected function rowToObject($row)
    {
        if ('array' == $this->returnDataType) {
            return $row;
        }

        if ($row) {
            $object = $this->createEntity();
            $this->loadObjectFromArray($object, $row);

            return $object;
        }

        return;
    }
276082
public function get($col, $row)
    {
        $this->checkCoords($col, $row);

        return $this->grid{$this->toIndex($col, $row)};
    }
345557
public function add($row = array())
    {
        //Argument 1 must be an array or Eden_Model
        Argument::i()->test(1, 'array', $this->model);
        
        //if it's an array
        if (is_array($row)) {
            //make it a model
            $model = trim(str_replace('\\', '_', $this->model), '_');
            $row = $this->$model($row);
        }
        
        if (!is_null($this->database)) {
            $row->setDatabase($this->database);
        }
        
        if (!is_null($this->table)) {
            $row->setTable($this->table);
        }
        
        //add it now
        $this->list[] = $row;
        
        return $this;
    }
1155729
public function execute($row = null)
    {
        if ($row) {
            if ((! isset($row['grs_id_user'])) &&
                    isset($row['grs_ssn']) &&
                    $this->targetModel instanceof \Gems_Model_RespondentModel &&
                    $this->targetModel->hashSsn !== \Gems_Model_RespondentModel::SSN_HIDE) {

                if (\Gems_Model_RespondentModel::SSN_HASH === $this->targetModel->hashSsn) {
                    $search = $this->targetModel->saveSSN($row['grs_ssn']);
                } else {
                    $search = $row['grs_ssn'];
                }

                $sql = 'SELECT grs_id_user FROM gems__respondents WHERE grs_ssn = ?';
                $id  = $this->db->fetchOne($sql, $search);

                // Check for change in patient ID
                if ($id) {
                    if (isset($row['gr2o_id_organization']) &&
                            $this->targetModel instanceof \MUtil_Model_DatabaseModelAbstract) {

                        $sql = 'SELECT gr2o_patient_nr
                                FROM gems__respondent2org
                                WHERE gr2o_id_user = ? AND gr2o_id_organization = ?';

                        $patientId = $this->db->fetchOne($sql, array($id, $row['gr2o_id_organization']));

                        if ($patientId) {
                            // Change the patient number
                            $copyId       = $this->targetModel->getKeyCopyName('gr2o_patient_nr');
                            $row[$copyId] = $patientId;
                        }
                    }

                    $row['grs_id_user']  = $id;
                    $row['gr2o_id_user'] = $id;
                }
            }

            parent::execute($row);
        }
    }
1181898
private static function orm(Row $data)
    {
        // exception_if( ! ( $data instanceof Row) , \LogicException::class , 'The result of Authentication query is not instance of Vinala\Kernel\Database\Row');

        $data = (array) $data;
        $id = array_shift($data);

        $model = config('auth.model');

        exception_if(!class_exists($model), AMNFE::class);

        return new $model($id);
    }
1027678
public function translateRowValues($row, $key)
    {
        $row = parent::translateRowValues($row, $key);

        if (! $row) {
            return false;
        }
        
        // Default to active and can login
        if (!isset($row['gsf_active'])) {
            $row['gsf_active'] = 1;
        }        
        if (!isset($row['gul_can_login'])) {
            $row['gul_can_login'] = 1;
        }
        
        // Make sure we have an organization
        if (!isset($row['gsf_id_organization'])) {
            $row['gsf_id_organization'] = $this->_organization->getId();
        }
        
        // Use organization default userclass is not specified
        if (!isset($row['gul_user_class'])) {
            $row['gul_user_class'] = $this->loader->getUserLoader()->getOrganization($row['gsf_id_organization'])->get('gor_user_class');
        }

        return $row;
    }