<commit_before><?php
namespace App\Model\Tables;

use Zend\Db\TableGateway\AbstractTableGateway;
use Zend\Db\TableGateway\Feature;
use Zend\Db\Adapter\Adapter;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\Sql\Select;
use Zend\Debug\Debug;
use Zend\Db\Sql\Expression;

class CapLeccionElementoTable extends AbstractTableGateway
{
    protected $table = 'cap_leccion_elemento';
    
    public function __construct()
    {
    	//$this->adapter = $adapter;
    	//$this->initialize();
    
    	$this->featureSet = new Feature\FeatureSet();
    	$this->featureSet->addFeature(new Feature\GlobalAdapterFeature());
    	$this->initialize();
    }
    
    
    public function getIdListByLeccion ($lid = 0, $key = 'lec_ele_orden') {
        $resultSet = $this->select((function (Select $select) {
             $select->where(array('lec_id' => $lid));
             $select->order('lec_ele_orden');
        });
        if ($resultRow = $resultSet->toArray()){ 
            $data = Array();
            foreach ( $resultRow as $r ) {
                $data[] = array('id'=>$r['uni_inf_id'], 'father'=>$r['uni_inf_from'], 'order'=>$r[$key]);
            }
            return $data;
        }else {
            return array();
        }
    }
    
    
}

?><commit_msg>Organizacion de preguntas, Bug1<commit_after><?php
namespace App\Model\Tables;

use Zend\Db\TableGateway\AbstractTableGateway;
use Zend\Db\TableGateway\Feature;
use Zend\Db\Adapter\Adapter;
use Zend\Db\ResultSet\ResultSet;
use Zend\Db\Sql\Select;
use Zend\Debug\Debug;
use Zend\Db\Sql\Expression;

class CapLeccionElementoTable extends AbstractTableGateway
{
    protected $table = 'cap_leccion_elemento';
    
    public function __construct()
    {
    	//$this->adapter = $adapter;
    	//$this->initialize();
    
    	$this->featureSet = new Feature\FeatureSet();
    	$this->featureSet->addFeature(new Feature\GlobalAdapterFeature());
    	$this->initialize();
    }
    
    
    public function getIdListByLeccion ($lid = 0, $key = 'lec_ele_orden') {
        $resultSet = $this->select(function (Select $select) {
             $select->where(array('lec_id' => $lid));
             $select->order('lec_ele_orden');
        });
        if ($resultRow = $resultSet->toArray()){ 
            $data = Array();
            foreach ( $resultRow as $r ) {
                $data[] = array('id'=>$r['uni_inf_id'], 'father'=>$r['uni_inf_from'], 'order'=>$r[$key]);
            }
            return $data;
        }else {
            return array();
        }
    }
    
    
}

?>
{'fraction_non_alphanumeric': 0.15687820260149785, 'fraction_numerical': 0.0011824990145841545, 'mean_word_length': 2.5546218487394956, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2979360', 'n_tokens_mistral': 826, 'n_tokens_neox': 815, 'n_words': 139}