PHP Classes

File: teste.php

Recommend this page to a friend!
  Classes of Axel Alexnder   Connection Factory   teste.php   Download  
File: teste.php
Role: Example script
Content type: text/plain
Description: Teste
Class: Connection Factory
Connect to database and run queries using Doctrine
Author: By
Last change:
Date: 7 years ago
Size: 872 bytes
 

Contents

Class file image Download
<?php
 
/*
 * Project: AX MVC
 * File : /models/Classificado.php
 * Purpose : model for the error controller.
 * Author : Axel Alexander Martins Benites
 */

require_once 'bootstrap.php';
require_once
'ConnectionFactory.php';
require_once
'entities/Notificacao.php';


#1 - conectar ao mysql
#2 - criar a tabela Notifica??o
 

// repositorio
$retorno = ConnectionFactory::getInstance()->RepositoryfindBy('Notificacao',
        array(
'usuario' => $id , 'id' => 2),
        array(
'id'=>'DESC'), null, null );

print_r ( $retorno ) ;


// query
function getAll($id){
       
$strSql = "SELECT n from Notificacao n WHERE n.id = :id ";
       
$setParam = array("id" => $id);
        return
ConnectionFactory::getInstance()->criarQuery(
       
$strSql , $setParam , 2);
}

$retorno = getAll(1);

print_r ( $retorno ) ;