db.php in Defender Security – Malware Scanner, Login Security & Firewall 3.0.1, at src/db.php
| 1 | <?php |
| 2 | |
| 3 | namespace WP_Defender; |
| 4 | |
| 5 | use Calotes\Base\Model; |
| 6 | use Calotes\DB\Mapper; |
| 7 | use Calotes\Helper\Array_Cache; |
| 8 | |
| 9 | class DB extends Model { |
| 10 | public function __construct() { |
| 11 | $this->parse_annotations(); |
| 12 | } |
| 13 | |
| 14 | /** |
| 15 | * Save the current instance |
| 16 | * @return int |
| 17 | */ |
| 18 | public function save() { |
| 19 | return self::get_orm()->save( $this ); |
| 20 | } |
| 21 | |
| 22 | /** |
| 23 | * @return Mapper |
| 24 | */ |
| 25 | protected static function get_orm() { |
| 26 | $orm = wd_di()->get( Mapper::class ); |
| 27 | |
| 28 | return $orm; |
| 29 | } |
| 30 | } |