protected static function detectTitle(array $title)
    {
        $assignment = $title['assignment'];
        if ($assignment === null) {
            return;
        }

        $where = array_merge(
            Utils\Utils::arrayWhitelist($title, [
                'assignment',
                'our_number',
                'due',
            ]),
            [
                'ORDER' => [
                    'stamp' => 'DESC',
                    'id' => 'DESC',
                ],
            ]
        );

        $ids = Models\Title::dump($where, 'id');
        if (empty($ids)) {
            return;
        }
        return $ids[0];
    }
protected static function detectTitle(array $title)
    {
        $assignment = $title['assignment'];
        if ($assignment === null) {
            return;
        }

        $where = array_merge(
            Utils\Utils::arrayWhitelist($title, [
                'assignment',
                'our_number',
                'due',
            ]),
            [
                'ORDER' => [
                    'stamp' => 'DESC',
                    'id' => 'DESC',
                ],
            ]
        );

        $ids = Models\Title::dump($where, 'id');
        if (empty($ids)) {
            return;
        }
        return $ids[0];
    }
protected static function detectTitle ( array $ title ) { $ assignment = $ title [ 'assignment' ] ; if ( $ assignment === null ) { return ; } $ where = array_merge ( Utils \ Utils :: arrayWhitelist ( $ title , [ 'assignment' , 'our_number' , 'due' , ] ) , [ 'ORDER' => [ 'stamp' => 'DESC' , 'id' => 'DESC' , ] , ] ) ; $ ids = Models \ Title :: dump ( $ where , 'id' ) ; if ( empty ( $ ids ) ) { return ; } return $ ids [ 0 ] ; }
Detects a Title in the database

@param mixed[] $title Extracted title data

@return string On success
@return null   On failure
Detects a Title in the database