/**
  * Returns a new ApiLogQuery object.
  *
  * @param     string $modelAlias The alias of a model in the query
  * @param   ApiLogQuery|Criteria $criteria Optional Criteria to build the query from
  *
  * @return ApiLogQuery
  */
 public static function create($modelAlias = null, $criteria = null)
 {
     if ($criteria instanceof ApiLogQuery) {
         return $criteria;
     }
     $query = new ApiLogQuery(null, null, $modelAlias);
     if ($criteria instanceof Criteria) {
         $query->mergeWith($criteria);
     }
     return $query;
 }
 /**
  * Returns the number of related ApiLog objects.
  *
  * @param Criteria $criteria
  * @param boolean $distinct
  * @param PropelPDO $con
  * @return int             Count of related ApiLog objects.
  * @throws PropelException
  */
 public function countApiLogs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
 {
     $partial = $this->collApiLogsPartial && !$this->isNew();
     if (null === $this->collApiLogs || null !== $criteria || $partial) {
         if ($this->isNew() && null === $this->collApiLogs) {
             return 0;
         }
         if ($partial && !$criteria) {
             return count($this->getApiLogs());
         }
         $query = ApiLogQuery::create(null, $criteria);
         if ($distinct) {
             $query->distinct();
         }
         return $query->filterByRemoteApp($this)->count($con);
     }
     return count($this->collApiLogs);
 }
 /**
  * Shows last api-log entry
  *
  * @param $id
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function lastLogAction($id)
 {
     $oLog = ApiLogQuery::create()->findOneByRemoteAppId($id);
     $oRemoteApp = RemoteAppQuery::create()->findOneById($id);
     return $this->render('SlashworksAppBundle:RemoteApp:log.html.twig', array('oLog' => $oLog, 'remote_app' => $oRemoteApp));
 }