protected function setOriginalName(\databox $databox, array $record)
    {
        static $stmt;

        if (!isset($stmt[$databox->get_sbas_id()])) {
            $sql = 'UPDATE record SET originalname = :originalname WHERE record_id = :record_id';
            $stmt[$databox->get_sbas_id()] = $databox->get_connection()->prepare($sql);
        }

        $original = '';

        if (false !== $sxe = simplexml_load_string($record['xml'])) {
            foreach ($sxe->doc->attributes() as $key => $value) {
                if (trim($key) != 'originalname') {
                    continue;
                }
                $original = basename(trim($value));
                break;
            }
        }

        $stmt[$databox->get_sbas_id()]->execute([':originalname' => $original, ':record_id'    => $record['record_id']]);
    }
protected function setOriginalName(\databox $databox, array $record)
    {
        static $stmt;

        if (!isset($stmt[$databox->get_sbas_id()])) {
            $sql = 'UPDATE record SET originalname = :originalname WHERE record_id = :record_id';
            $stmt[$databox->get_sbas_id()] = $databox->get_connection()->prepare($sql);
        }

        $original = '';

        if (false !== $sxe = simplexml_load_string($record['xml'])) {
            foreach ($sxe->doc->attributes() as $key => $value) {
                if (trim($key) != 'originalname') {
                    continue;
                }
                $original = basename(trim($value));
                break;
            }
        }

        $stmt[$databox->get_sbas_id()]->execute([':originalname' => $original, ':record_id'    => $record['record_id']]);
    }
protected function setOriginalName ( \ databox $ databox , array $ record ) { static $ stmt ; if ( ! isset ( $ stmt [ $ databox -> get_sbas_id ( ) ] ) ) { $ sql = 'UPDATE record SET originalname = :originalname WHERE record_id = :record_id' ; $ stmt [ $ databox -> get_sbas_id ( ) ] = $ databox -> get_connection ( ) -> prepare ( $ sql ) ; } $ original = '' ; if ( false !== $ sxe = simplexml_load_string ( $ record [ 'xml' ] ) ) { foreach ( $ sxe -> doc -> attributes ( ) as $ key => $ value ) { if ( trim ( $ key ) != 'originalname' ) { continue ; } $ original = basename ( trim ( $ value ) ) ; break ; } } $ stmt [ $ databox -> get_sbas_id ( ) ] -> execute ( [ ':originalname' => $ original , ':record_id' => $ record [ 'record_id' ] ] ) ; }
Update the original name of a record

@staticvar \PDO_statement $stmt
@param \databox $databox
@param array    $record
Update the original name of a record