PHP Classes

Connection Factory: Connect to database and run queries using Doctrine

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 130 This week: 1All time: 9,338 This week: 560Up
Version License PHP version Categories
connectionfactory 1Free For Educatio...5PHP 5, Databases, Design Patterns
Description 

Author

This class can connect to database and run queries using Doctrine.

It can create a Doctrine entity manager using configuration values.

The class can also perform common object queries on models like find one, find all, find by criteria, create queries, save objects, etc..

Picture of Axel Alexnder
  Performance   Level  
Name: Axel Alexnder <contact>
Classes: 1 package by
Country: Brazil Brazil
Age: 38
All time rank: 4324351 in Brazil Brazil
Week rank: 416 Up36 in Brazil Brazil Up

Example

<?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 ) ;


Details

ConnectionFactory : 1. conexao com mysql 2. Implementa??o de crud Thanks to Maria Eduarda Carvalho Benites e Camila Batalha Carvalho este e o meu primeiro projeto de varios http://axeldeveloper.esy.es/#/home

  Files folder image Files  
File Role Description
Files folder imageentities (1 file)
Accessible without login Plain text file bootstrap.php Aux. inicial
Plain text file ConectionFactory.php Class Class
Accessible without login Plain text file README Doc. README
Accessible without login Plain text file teste.php Example Teste

  Files folder image Files  /  entities  
File Role Description
  Plain text file Notificacao.php Class entidade

 Version Control Unique User Downloads Download Rankings  
 0%
Total:130
This week:1
All time:9,338
This week:560Up