Symfony: error accessing an array

I want to output an array containing numbers.

I create such an array (he received statistics for the last 7 days):

   <?php  public function getStatisticsTeams()
 {
  $tab = array();
  for($i=7;$i=0;$i--)
     {
   $q = Doctrine_Query::create()
   ->from('stJob j')
   ->where('j.created_at = ?', date('Y-m-d h:i:s' , time() - 86400 * $i ))
    ->execute()
   ->count();
   $tab[] = $q;
     }
   return $tab;
 }

action.class.php

$this->st_job = Doctrine::getTable('StJob')->getStatisticsTeams();

Using an array in template.php template:

$chart->inlineGraph(array('hits' => $st_job), array('Monday', 'Tuesday', 'Wednesday' ....), 'div_id');

When I try to access my array , it fails because the function used must have an array that should contain, for example, (43,5,87,3,29,8,10), and when I var_dump($st_job)(my array)

object(sfOutputEscaperArrayDecorator)#363 (3) { ["count":"sfOutputEscaperArrayDecorator":private]=>  int(0) ["value":protected]=>  array(0) { } ["escapingMethod":protected]=>  string(16) "esc_specialchars" } 

Do you have any idea what I'm doing wrong?

thank

+5
source share
1 answer

, symfony , . , , :

$original_array = $sf_data->getRaw('st_job');
+13

All Articles