Proyectos de Subversion LeadersLinked - Services

Rev

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

Rev 587 Rev 590
Línea 80... Línea 80...
80
        $select->where->equalTo('company_id', $company_id);
80
        $select->where->equalTo('company_id', $company_id);
81
        $select->order(['order', 'name']);
81
        $select->order(['order', 'name']);
82
        return $this->executeFetchAllObject($select, $prototype);
82
        return $this->executeFetchAllObject($select, $prototype);
83
    }
83
    }
Línea -... Línea 84...
-
 
84
 
-
 
85
    public function fetchAllByCapsuleId($capsule_id)
-
 
86
    {
-
 
87
        $prototype = new MicrolearningSlide();
-
 
88
        $select = $this->sql->select(self::_TABLE);
-
 
89
        $select->where->equalTo('capsule_id', $capsule_id);
-
 
90
        $select->order(['order', 'name']);
-
 
91
        return $this->executeFetchAllObject($select, $prototype);
-
 
92
    }
84
 
93
 
85
    /**
94
    /**
86
     * Fetch slides by company ID and capsule ID
95
     * Fetch slides by company ID and capsule ID
87
     * @param int $company_id
96
     * @param int $company_id
88
     * @param int $capsule_id
97
     * @param int $capsule_id
Línea 274... Línea 283...
274
        $paginator->setItemCountPerPage($records_per_page);
283
        $paginator->setItemCountPerPage($records_per_page);
275
        $paginator->setCurrentPageNumber($page);
284
        $paginator->setCurrentPageNumber($page);
Línea 276... Línea 285...
276
        
285
        
277
        return $paginator;
286
        return $paginator;
-
 
287
    }
-
 
288
 
-
 
289
    /**
-
 
290
     * Get total count of slides by company ID and topic ID
-
 
291
     * @param int $companyId
-
 
292
     * @param int $topicId
-
 
293
     * @return int
-
 
294
     */
-
 
295
    public function fetchTotalCountByCompanyIdAndTopicId($companyId, $topicId)
-
 
296
    {
-
 
297
        $select = $this->sql->select();
-
 
298
        $select->columns(['total' => new Expression('COUNT(*)')]);
-
 
299
        $select->from(self::_TABLE);
-
 
300
        $select->where->equalTo('company_id', $companyId);
-
 
301
        $select->where->equalTo('topic_id', $topicId);
-
 
302
        $record = $this->executeFetchOneArray($select);
-
 
303
        return (int)$record['total'];
278
    }
304
    }
279
}
305
}