Location: PHPKode > projects > Spiral > ametaireau-spiral-272a2b1/public/test.php
<?php

class Article
{
	public $id;
	public $title;
	public $content;
}

$pdo = new \PDO('mysql:dbname=spiral;host=127.0.0.1', 'root', 'kwait');
$or = new \spiral\framework\persistence\PDOObjectRepository($pdo);

$article = new Article();
$article->id = null;
$article->title = 'Hello world !';
$article->content = 'Content here';

$oid = $or->add($article);

var_dump($oid);
Return current item: Spiral