protected function proceedSubmitRecordLabels($submitRecordId, array $submitRecordLabels)
    {
        foreach ($submitRecordLabels as $labelInfo) {
            // There must be no author of a label, let set a default one
            $by = array('id' => 0);
            if (array_key_exists('by', $labelInfo) === true) {
                $by = $this->proceedPerson($labelInfo['by']);
            }

            $submitRecordLabelRow = $this->getGerritSubmitRecordLabelByIdentifier($submitRecordId, $labelInfo['label']);

            $submitRecordLabel = array(
                'submit_record' => $submitRecordId,
                'label' => $labelInfo['label'],
                'status' => $labelInfo['status'],
                'by' => $by['id']
            );
            if ($submitRecordLabelRow === false) {
                $this->getDatabase()->insertRecord(Database::TABLE_SUBMIT_RECORD_LABELS, $submitRecordLabel);

            } else {
                $this->getDatabase()->updateRecord(
                    Database::TABLE_SUBMIT_RECORD_LABELS,
                    $submitRecordLabelRow,
                    $submitRecordLabelRow['id']
                );
            }

            $labelInfo = $this->unsetKeys($labelInfo, array('label', 'status', 'by'));
            $this->checkIfAllValuesWereProceeded($labelInfo, 'Submit record label');
        }
    }
protected function proceedSubmitRecordLabels($submitRecordId, array $submitRecordLabels)
    {
        foreach ($submitRecordLabels as $labelInfo) {
            // There must be no author of a label, let set a default one
            $by = array('id' => 0);
            if (array_key_exists('by', $labelInfo) === true) {
                $by = $this->proceedPerson($labelInfo['by']);
            }

            $submitRecordLabelRow = $this->getGerritSubmitRecordLabelByIdentifier($submitRecordId, $labelInfo['label']);

            $submitRecordLabel = array(
                'submit_record' => $submitRecordId,
                'label' => $labelInfo['label'],
                'status' => $labelInfo['status'],
                'by' => $by['id']
            );
            if ($submitRecordLabelRow === false) {
                $this->getDatabase()->insertRecord(Database::TABLE_SUBMIT_RECORD_LABELS, $submitRecordLabel);

            } else {
                $this->getDatabase()->updateRecord(
                    Database::TABLE_SUBMIT_RECORD_LABELS,
                    $submitRecordLabelRow,
                    $submitRecordLabelRow['id']
                );
            }

            $labelInfo = $this->unsetKeys($labelInfo, array('label', 'status', 'by'));
            $this->checkIfAllValuesWereProceeded($labelInfo, 'Submit record label');
        }
    }
protected function proceedSubmitRecordLabels ( $ submitRecordId , array $ submitRecordLabels ) { foreach ( $ submitRecordLabels as $ labelInfo ) { // There must be no author of a label, let set a default one $ by = array ( 'id' => 0 ) ; if ( array_key_exists ( 'by' , $ labelInfo ) === true ) { $ by = $ this -> proceedPerson ( $ labelInfo [ 'by' ] ) ; } $ submitRecordLabelRow = $ this -> getGerritSubmitRecordLabelByIdentifier ( $ submitRecordId , $ labelInfo [ 'label' ] ) ; $ submitRecordLabel = array ( 'submit_record' => $ submitRecordId , 'label' => $ labelInfo [ 'label' ] , 'status' => $ labelInfo [ 'status' ] , 'by' => $ by [ 'id' ] ) ; if ( $ submitRecordLabelRow === false ) { $ this -> getDatabase ( ) -> insertRecord ( Database :: TABLE_SUBMIT_RECORD_LABELS , $ submitRecordLabel ) ; } else { $ this -> getDatabase ( ) -> updateRecord ( Database :: TABLE_SUBMIT_RECORD_LABELS , $ submitRecordLabelRow , $ submitRecordLabelRow [ 'id' ] ) ; } $ labelInfo = $ this -> unsetKeys ( $ labelInfo , array ( 'label' , 'status' , 'by' ) ) ; $ this -> checkIfAllValuesWereProceeded ( $ labelInfo , 'Submit record label' ) ; } }
Proceed the labels of a 'submitRecord' key of a changeset

@param int $submitRecordId
@param array $submitRecordLabels
@return void
Proceed the labels of a submitRecord key of a changeset