• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

miaoxing / services / 7322930216

25 Dec 2023 04:02PM UTC coverage: 10.534% (-0.8%) from 11.327%
7322930216

push

github

twinh
ci: add PHP 8, remove PHP 7.2, 7.3

69 of 655 relevant lines covered (10.53%)

10.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Service/Db.php
1
<?php
2

3
namespace Miaoxing\Services\Service;
4

5
use Miaoxing\Plugin\Service\WeiBaseModel;
6

7
/**
8
 * @property \Wei\BaseCache $cache
9
 */
10
class Db extends \Wei\Db
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function getTableFields($table, $withPrefix = false)
16
    {
17
        $fullTable = $withPrefix ? $table : $this->getTable($table);
×
18
        if (isset($this->tableFields[$fullTable])) {
×
19
            return $this->tableFields[$fullTable];
×
20
        } else {
21
            return (array) $this->cache->remember(
×
22
                'tableFields' . $this->dbname . '.' . $table,
×
23
                60,
×
24
                function () use ($table, $withPrefix) {
×
25
                    return parent::getTableFields($table, $withPrefix);
×
26
                }
×
27
            );
×
28
        }
29
    }
30

31
    /**
32
     * Init a model instance
33
     *
34
     * @param string $table The name of database table
35
     * @param array $attribuets The data for table record
36
     * @param bool $new Whether it's a new record and have not save to database
37
     * @return WeiBaseModel
38
     */
39
    public function init($table, $attribuets = [], $new = true)
40
    {
41
        $class = $this->getRecordClass($table);
×
42
        return new $class([
×
43
            'wei' => $this->wei,
×
44
            'db' => $this,
×
45
            'table' => $table,
×
46
            'new' => $new,
×
47
            'attributes' => $attribuets,
×
48
        ]);
×
49
    }
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc