<commit_before><?php
/**
 * Created by PhpStorm.
 * User: Raffaele
 * Date: 17/11/2016
 * Time: 18:39
 */

namespace AppBundle\Manager;
use AppBundle\Model\Squadra;
use AppBundle\Utility\DB;


class GestioneSquadra
{

   private $conn;
    private $db;

    public function __construct()
    {
        $this->db=new DB();
        $this->conn=$this->db->connect();
    }

    public function insert($idSquadre,$nome,$annoFondazione,$presidente,$sedeLegale,$urlScudetto)
    {

        $query="INSERT INTO squadre (idSquadre, nome, annoFondazione, presidente, sedeLegale, urlScudetto) VALUES ('$idSquadre', '$nome', '$annoFondazione', '$presidente', '$sedeLegale', '$urlScudetto')";
        if (!$this->conn->query($query)) {
            die($this->conn->error);
        }


    }
    /*ciao*/
    public function get(){

        $squadre=array();
        $sql="SELECT * from squadre";
        $result = $this->conn->query($sql);
        $res="";
        $i=0;
        if ($result->num_rows > 0) {
            // output data of each row
            while($row = $result->fetch_assoc()) {
                $s=new Squadra();
                $s->setNome($row["nome"]);
                $s->setIdSquadre($row["idSquadre"]);
                $s->setAnnoFondazione($row["annoFondazione"]);
                $s->setPresidente($row["presidente"]);
                $s->setSedeLegale($row["sedeLegale"]);
                $s->setUrlScudetto($row["urlScudetto"]);
                $squadre[$i]=$s;
                $i++;
                //$res=$res. "id: " . $row["idSquadre"]. " - Name: " . $row["nome"]. "<br>";
            }
            return $squadre;
        } else {
            return null;
        }


    }

    public function getById($id){<commit_msg>commit commento<commit_after><?php
/**
 * Created by PhpStorm.
 * User: Raffaele
 * Date: 17/11/2016
 * Time: 18:39
 */

namespace AppBundle\Manager;
use AppBundle\Model\Squadra;
use AppBundle\Utility\DB;


class GestioneSquadra
{

   private $conn;
    private $db;

    public function __construct()
    {
        $this->db=new DB();
        $this->conn=$this->db->connect();
    }

    public function insert($idSquadre,$nome,$annoFondazione,$presidente,$sedeLegale,$urlScudetto)
    {

        $query="INSERT INTO squadre (idSquadre, nome, annoFondazione, presidente, sedeLegale, urlScudetto) VALUES ('$idSquadre', '$nome', '$annoFondazione', '$presidente', '$sedeLegale', '$urlScudetto')";
        if (!$this->conn->query($query)) {
            die($this->conn->error);
        }


    }
    /*ci*/
    public function get(){

        $squadre=array();
        $sql="SELECT * from squadre";
        $result = $this->conn->query($sql);
        $res="";
        $i=0;
        if ($result->num_rows > 0) {
            // output data of each row
            while($row = $result->fetch_assoc()) {
                $s=new Squadra();
                $s->setNome($row["nome"]);
                $s->setIdSquadre($row["idSquadre"]);
                $s->setAnnoFondazione($row["annoFondazione"]);
                $s->setPresidente($row["presidente"]);
                $s->setSedeLegale($row["sedeLegale"]);
                $s->setUrlScudetto($row["urlScudetto"]);
                $squadre[$i]=$s;
                $i++;
                //$res=$res. "id: " . $row["idSquadre"]. " - Name: " . $row["nome"]. "<br>";
            }
            return $squadre;
        } else {
            return null;
        }


    }

    public function getById($id){
{'fraction_non_alphanumeric': 0.17900172117039587, 'fraction_numerical': 0.008032128514056224, 'mean_word_length': 2.069542253521127, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 43, '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': '5819227', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1139, 'n_words': 192}