Bonjour,
J'ai créer une base de donnée composés de ses classes:
Bureaux:
connection: doctrine
tableName: bureaux
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
membres_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
titre:
type: string(100)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
description:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
note:
type: float()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
classement:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
etat:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
date_ajout:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Membres:
local: membres_id
foreign: id
type: one
BureauxPhotos:
local: id
foreign: bureaux_id
type: many
Commentaires:
local: id
foreign: bureaux_id
type: many
Photos:
local: id
foreign: bureaux_id
type: many
Votes:
local: id
foreign: bureaux_id
type: many
BureauxPhotos:
connection: doctrine
tableName: bureaux_photos
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
photos_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
bureaux_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
principale:
type: integer(4)
fixed: false
unsigned: false
primary: false
default: '0'
notnull: false
autoincrement: false
relations:
Bureaux:
local: bureaux_id
foreign: id
type: one
Photos:
local: photos_id
foreign: id
type: one
Commentaires:
connection: doctrine
tableName: commentaires
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
membres_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
bureaux_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
texte:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
ip:
type: string(16)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
date_ajout:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
etat:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Bureaux:
local: bureaux_id
foreign: id
type: one
Membres:
local: membres_id
foreign: id
type: one
Membres:
connection: doctrine
tableName: membres
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
login:
type: string(20)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
email:
type: string(150)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
pass:
type: string(32)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
date_inscription:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
ip_inscription:
type: string(16)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
last_login:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
lvl:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
pays:
type: string(2)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
etat:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Bureaux:
local: id
foreign: membres_id
type: many
Commentaires:
local: id
foreign: membres_id
type: many
Votes:
local: id
foreign: membres_id
type: many
Photos:
connection: doctrine
tableName: photos
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
bureaux_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
url:
type: string(250)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
date_ajout:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
etat:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Bureaux:
local: bureaux_id
foreign: id
type: one
BureauxPhotos:
local: id
foreign: photos_id
type: many
Votes:
connection: doctrine
tableName: votes
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
membres_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
bureaux_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
note:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Bureaux:
local: bureaux_id
foreign: id
type: one
Membres:
local: membres_id
foreign: id
type: one
Lors d'insertion pas de resultat:
class mainActions extends sfActions
{
/**
* Executes index action
*
* @param sfRequest $request A request object
*/
public function executeIndex(sfWebRequest $request)
{
$monBureau= new Bureaux();
$monBureau->setTitre('Mon bureau');
$monBureau->setDescription(" Mon bureau est vraiment trés ergonomique, tout est à ma porté");
$monBureau->setNote(17);
$monBureau->setClassement(1);
$monBureau->setEtat(1);
$monBureau->setDateAjout(date("Y-m-d H:i:s"));
echo " avant sauvegarde ";
echo $monBureau;
$monBureau->save();
echo " aprés sauvegarde";
echo $monBureau;
Partager