Passed
Pull Request — master (#1)
by
unknown
01:35
created

Socials::getUserSocials()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Example\Models;
4
5
use CoffeeCode\DataLayer\DataLayer;
6
7
/**
8
 * Class Socials
9
 * @package Example\Models
10
 */
11
class Socials extends DataLayer
12
{
13
    /**
14
     * Socials constructor.
15
     */
16
    public function __construct()
17
    {
18
        parent::__construct("socials", ["social", "link"]);
19
    }
20
21
    /**
22
     * @param int    $user_id
23
     * @param string $columns
24
     * @return array|null
25
     */
26
    public function getUserSocials(int $user_id, string $columns = '*'): ?array
27
    {
28
        return $this->find("user_id = :id", "id={$user_id}", $columns)->fetch(true);
29
    }
30
}