✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ premium290.web-hosting.com ​🇻​♯➤ 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 63.250.38.37 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.95
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/tdhomesa/public_html/wp-content/plugins/mailpoet/lib/Settings//SettingsRepository.php
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing

namespace MailPoet\Settings;

if (!defined('ABSPATH')) exit;


use MailPoet\Doctrine\Repository;
use MailPoet\Entities\SettingEntity;
use MailPoetVendor\Carbon\Carbon;
use MailPoetVendor\Doctrine\ORM\Query;

/**
 * @extends Repository<SettingEntity>
 */
class SettingsRepository extends Repository {
  public function findOneByName(string $name): ?SettingEntity {
    // Always fetch fresh entity data (= don't use "findOneBy()"). See also further below.
    $result = (array)$this->doctrineRepository->createQueryBuilder('s')
      ->where('s.name = :name')
      ->setParameter('name', $name)
      ->getQuery()
      ->setHint(Query::HINT_REFRESH, true)
      ->getResult();

    return isset($result[0]) && $result[0] instanceof SettingEntity ? $result[0] : null;
  }

  public function createOrUpdateByName($name, $value) {
    // Temporarily use low-level INSERT ... ON DUPLICATE KEY UPDATE query to avoid race conditions
    // between entity fetch and creation with multiple concurrent requests. This will be replaced
    // by a code solving atomicity of create-or-update on entity (ORM) level in a follow-up ticket.
    $now = Carbon::now()->millisecond(0);
    $tableName = $this->entityManager->getClassMetadata(SettingEntity::class)->getTableName();
    $this->entityManager->getConnection()->executeStatement("
      INSERT INTO $tableName (name, value, created_at, updated_at)
      VALUES (:name, :value, :now, :now)
      ON DUPLICATE KEY UPDATE value = :value, updated_at = :now
    ", [
      'name' => $name,
      'value' => is_array($value) ? serialize($value) : $value,
      'now' => $now,
    ]);

    // Ensure entity data is up-to-date in memory.
    //  - We can't use "refresh()"; we don't have the entity instance, and it can be a new record.
    //  - We can't use "findOneBy()"; it could return a cached entity instance.
    $this->findOneByName($name);
  }

  protected function getEntityClassName() {
    return SettingEntity::class;
  }
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
11 Jun 2026 10.18 AM
tdhomesa / tdhomesa
0755
Charsets.php
0.525 KB
6 Dec 2022 4.54 PM
tdhomesa / tdhomesa
0644
Hosts.php
5.666 KB
5 May 2026 4.12 PM
tdhomesa / tdhomesa
0644
Pages.php
4.049 KB
21 Oct 2025 4.20 PM
tdhomesa / tdhomesa
0644
SettingsChangeHandler.php
4.754 KB
5 May 2026 4.12 PM
tdhomesa / tdhomesa
0644
SettingsController.php
9.526 KB
19 May 2026 4.31 PM
tdhomesa / tdhomesa
0644
SettingsRepository.php
2.026 KB
21 Aug 2024 9.39 AM
tdhomesa / tdhomesa
0644
TrackingConfig.php
1.774 KB
3 Feb 2026 5.17 PM
tdhomesa / tdhomesa
0644
UserFlagsController.php
2.729 KB
14 Jan 2025 7.40 PM
tdhomesa / tdhomesa
0644
UserFlagsRepository.php
0.405 KB
6 Dec 2022 4.54 PM
tdhomesa / tdhomesa
0644
index.php
0.006 KB
25 Apr 2023 6.18 PM
tdhomesa / tdhomesa
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF