PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.16
Yatra – Travel Booking & Tour Operator Software v3.0.16
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
← All changes | app/Repositories/DifficultyLevelRepository.php +25 -1 3.0.2.7 → 3.0.16 View file →
@@ -27,9 +27,9 @@
27 27 * Constructor
28 28 */
29 29 public function __construct()
30 30 {
31 - parent::__construct(ClassificationsTable::getTableName());
31 + parent::__construct();
32 32 }
33 33
34 34 /**
35 35 * Get table name
@@ -51,8 +51,32 @@
51 51 ClassificationTypes::DIFFICULTY,
52 52 $slug
53 53 )
54 54 );
55 + return $result ?: null;
56 + }
57 +
58 + /**
59 + * Find by name (case-insensitive match)
60 + */
61 + public function findByName(string $name): ?\stdClass
62 + {
63 + $name = trim($name);
64 + if ($name === '') {
65 + return null;
66 + }
67 +
68 + $table = esc_sql($this->table);
69 + $result = $this->wpdb->get_row(
70 + $this->wpdb->prepare(
71 + "SELECT * FROM `{$table}`
72 + WHERE type = %s AND LOWER(name) = LOWER(%s)
73 + LIMIT 1",
74 + ClassificationTypes::DIFFICULTY,
75 + $name
76 + )
77 + );
78 +
55 79 return $result ?: null;
56 80 }
57 81
58 82 /**