Ejemplo n.º 1
0
<?php

class myExampleSet extends weeDbSet
{
    public function fetch($iId)
    {
        return $this->getDb()->query('
			SELECT * FROM table WHERE the_id=?
		', $iId)->rowClass('myExampleModel')->fetch();
    }
    public static function instance()
    {
        return new self();
    }
}
// Example use:
$oModel = myExampleSet::instance()->fetch(42);
Ejemplo n.º 2
0
<?php

class myExampleSet extends weeDbSet
{
    public function fetch($iId)
    {
        return $this->getDb()->query('
			SELECT * FROM table WHERE the_id=?
		', $iId)->rowClass('myExampleModel')->fetch();
    }
}
// Example use:
$oSet = new myExampleSet();
$oModel = $oSet->fetch(42);
Ejemplo n.º 3
0
<?php

class myExampleSet extends weeDbSet
{
    protected $sModel = 'myExampleModel';
    public function fetch($iId)
    {
        return $this->queryRow('
			SELECT * FROM table WHERE the_id=?
		', $iId);
    }
    public function fetchAll()
    {
        return $this->query('
			SELECT * FROM table
		');
    }
    public static function instance()
    {
        return new self();
    }
}
// Example use:
$oModel = myExampleSet::instance()->fetch(42);
$oResults = myExampleSet::instance()->fetchAll();
Ejemplo n.º 4
0
<?php

$iCount = count(myExampleSet::instance());
Ejemplo n.º 5
0
class myExampleSet extends weeDbSet
{
    protected $sModel = 'myExampleModel';
    public function count()
    {
        return $this->queryValue('
			SELECT COUNT(*) FROM table
		');
    }
    public function fetch($iId)
    {
        return $this->queryRow('
			SELECT * FROM table WHERE the_id=?
		', $iId);
    }
    public function fetchAll()
    {
        return $this->query('
			SELECT * FROM table
		');
    }
    public static function instance()
    {
        return new self();
    }
}
// Example use:
$oModel = myExampleSet::instance()->fetch(42);
$oResults = myExampleSet::instance()->fetchAll();
$iCount = myExampleSet::instance()->count();