Proyectos de Subversion LeadersLinked - Services

Rev

Rev 357 | Rev 359 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 357 Rev 358
Línea 52... Línea 52...
52
    }
52
    }
Línea 53... Línea 53...
53
 
53
 
54
    /**
54
    /**
55
     * 
55
     * 
-
 
56
     * @param int $id
56
     * @param int $id
57
     * @return array
57
     */
58
     */
58
    public function fetchFiveteen($id)
59
    public function fetchFiveteen($id)
-
 
60
    {
59
    {
61
        // Crear el objeto de selección
60
        $select = $this->sql->select(self::_TABLE_C);
62
        $select = $this->sql->select(self::_TABLE_C);
61
        $select->where->equalTo('user_id', $id);
63
        $select->where->equalTo('user_id', $id);
62
        $select->order('created_at DESC');
64
        $select->order('created_at DESC');
Línea -... Línea 65...
-
 
65
        $select->limit(15);
-
 
66
 
-
 
67
        // Ejecutar la consulta
-
 
68
        $statement = $this->sql->prepareStatementForSqlObject($select);
-
 
69
        $results = $statement->execute();
-
 
70
 
-
 
71
        // Convertir los resultados en un array
-
 
72
        $records = [];
-
 
73
        foreach ($results as $row) {
-
 
74
            $records[] = $row;
63
        $select->limit(15);
75
        }
64
 
76
 
Línea 65... Línea 77...
65
        return $select;
77
        return $records;
66
    }
78
    }
67
 
79
 
Línea 72... Línea 84...
72
    public function fetchFiveteenByUuid($uuid)
84
    public function fetchFiveteenByUuid($uuid)
73
    {
85
    {
74
        $select = $this->sql->select(self::_TABLE_C);
86
        $select = $this->sql->select(self::_TABLE_C);
75
        $select->where->equalTo('uuid', $uuid);
87
        $select->where->equalTo('uuid', $uuid);
76
        $select->order('created_at DESC');
88
        $select->order('created_at DESC');
77
        $select->limit(1);
89
        $select->limit(15);
Línea 78... Línea 90...
78
 
90
 
79
        return $select;
91
        return $select;
Línea 80... Línea 92...
80
    }
92
    }