| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- namespace MGModule\DNSManager2\models\custom\reverse;
- use MGModule\DNSManager2 as main;
- use MGModule\DNSManager2\mgLibs\custom\dns\record\interfaces\ArrayPrinter;
- /**
- *
- *
- * @Table(name=reverse)
- */
- class Reverse extends main\mgLibs\models\orm implements ArrayPrinter {
- /**
- * ID field
- *
- * @Column(id)
- * @var int
- */
- public $id;
-
- /**
- *
- * @Column(int=11,uniqueKey=1)
- * @var int
- */
- public $serverid;
-
- /**
- *
- * @Column(int=11)
- * @var int
- */
- public $clientid;
- /**
- *
- * @Column(int=1)
- * @var int
- */
- public $type;
- /**
- *
- * @Column(int=11)
- * @var int
- */
- public $relid;
-
- /**
- *
- * @Column(varchar,isKey=1)
- * @var string
- */
- public $from;
-
- /**
- *
- * @Column(varchar,isKey=1)
- * @var string
- */
- public $sub;
-
- /**
- *
- * @Column(varchar)
- * @var string
- */
- public $name;
-
- /**
- *
- * @Column(varchar,uniqueKey=1,isKey=1)
- * @var string
- */
- public $ip;
-
- /**
- *
- * @Column(varchar)
- * @var string
- */
- public $ttl;
-
- /**
- *
- * @Column(datetime)
- * @var string
- */
- public $created_at;
-
- public static function byServerIDAndIP($serverid, $ip) {
- return Repository::factory()->byServerID($serverid)->byIP($ip)->one();
- }
- public function getServer() {
- return new main\models\custom\server\Server($this->serverid);
- }
-
- public function getFullDomain() {
- return ($this->sub?$this->sub . '.':'') . $this->from;
- }
-
- /** @return main\mgLibs\custom\dns\SubmoduleAbstract */
- public function getModule() {
- $module = $this->getServer()->getModule();
- $module->setDomain($this->from);
- return $module;
- }
- }
|