コード例 #1
0
 private function __construct()
 {
     $this->hydrator = new ConstructorlessHydrator();
     $this->connection = Connection::getConnection();
     $this->cache = new EntityCache();
 }
コード例 #2
0
ファイル: demo.php プロジェクト: LartTyler/Link
<?php

namespace DaybreakStudios\Link\Demos;

use DaybreakStudios\Link\Connection\Adapter\MySqlPdoAdapter;
use DaybreakStudios\Link\Connection\Connection;
use DaybreakStudios\Link\Entity\Entity;
require __DIR__ . '/vendor/autoload.php';
$conn = Connection::create(new MySqlPdoAdapter('link_demo', '127.0.0.1', 'root', ''));
/**
 * @method int getId()
 * @method string getBirthplace()
 * @method $this setBirthplace(string $birthplace)
 * @method int getAge()
 * @method $this setAge(int $age)
 */
class Biography extends Entity
{
}
/**
 * @method int getId()
 * @method string getContent()
 * @method $this setContent(string $content)
 * @method \DateTime getPostedOn()
 * @method $this setPostedOn(\DateTime $postedOn)
 * @method bool isDeleted()
 * @method $this setDeleted(bool $deleted)
 * @method string getTitle()
 * @method $this setTitle(string $title)
 * @method User getUser()
 * @method string getUserEmail()
コード例 #3
0
ファイル: TreeManager.php プロジェクト: LartTyler/Link
 public function __construct($ast, $ctx = null, Connection $connection = null)
 {
     $this->ast = $ast;
     $this->ctx = $ctx;
     $this->connection = $connection ?? Connection::getConnection();
 }
コード例 #4
0
ファイル: cli-config.php プロジェクト: LartTyler/Link
<?php

require_once __DIR__ . '/vendor/autoload.php';
$adapter = new \DaybreakStudios\Link\Connection\Adapter\MySqlPdoAdapter('link_demo', '127.0.0.1', 'root', '');
$connection = \DaybreakStudios\Link\Connection\Connection::create($adapter);
return new \Symfony\Component\Console\Helper\HelperSet(['connection' => new \DaybreakStudios\Link\Console\Helper\ConnectionHelper($connection), 'destination' => new \DaybreakStudios\Link\Console\Helper\DestinationHelper(__DIR__ . '/entities')]);
コード例 #5
0
ファイル: AbstractReader.php プロジェクト: LartTyler/Link
 /**
  * @return string
  */
 public function getSchema() : string
 {
     return $this->connection->getSchema();
 }