public function convertToPHPValue($value, \Doctrine\DBAL\Platforms\AbstractPlatform $platform) { if ($value) { return \Billing\Core::getEm()->getReference("Billing\\Domain\\Subscriber", $value); } else { return null; } }
function update($id, $name, $status, $description) { $st = \Billing\Core::getEm()->getConnection()->prepare("exec TVEIpTVChannelUpd :ID, :Name, :Status, :Description"); $st->bindValue(":ID", $id); $st->bindValue(":Name", $name); $st->bindValue(":Status", $status); $st->bindValue(":Description", $description); $st->execute(); }
/** * @covers TVEIpTVChannelRepository::update * @todo Implement testUpdate(). */ public function testUpdate() { //этот тест никогда не проходит, хотя процедура работает правильно. вероятно особенности транзакций \Billing\Core::getEm()->getConnection()->beginTransaction(); $this->object->update(653, "testUpdateName", \Billing\Domain\TVEIpTVChannel::STATUS_NONACTIVE, "testUpdateDescription"); /* @var $actual \Billing\Domain\TVEIpTVChannel */ $actual = \Billing\Core::getEm()->find("Billing\\Domain\\TVEIpTVChannel", 653); //$this->assertEquals("testUpdateName", $actual->getName()); \Billing\Core::getEm()->getConnection()->rollBack(); }
function init() { /* @var $model \Billing\Searcher */ $model = $this->getModel(); parent::init(); $this->_filterView->init(); $this->_idView->init(); if ($this->_idView->getModel()) { $this->_model = \Billing\Core::getEm()->find('Billing\\Domain\\Subscriber', $this->_idView->getModel()); } else { $this->_model = null; } }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this->object = new SubscriberView(\Billing\Core::getEm()->find("Billing\\Domain\\Subscriber", 299790), null, "subscriber1"); }
static function add(TVEIpTVChannel $object, $account, $serviceAccount = null, $tariffPlanNamePeriod = null, $dateFrom = null, $dateTo = null, $calcPeriod = null) { $result; $st = \Billing\Core::getEm()->getConnection()->prepare("exec ServiceAccountPeriodObjectAdd :ID, :ServiceAccountID, :AccountNumber, :TariffPlanNamePeriodID, :ObjectID, :DateFrom, :DateTo, :CalcPeriod"); $st->bindParam(":ID", $result, \PDO::PARAM_INT | \PDO::PARAM_INPUT_OUTPUT, 12); $st->bindValue(":ServiceAccountID", $serviceAccount ? $serviceAccount->getId() : null); $st->bindValue(":AccountNumber", $account ? $account->getNumber() : null); $st->bindValue(":TariffPlanNamePeriodID", $tariffPlanNamePeriod ? $tariffPlanNamePeriod->getId() : null); $st->bindValue(":ObjectID", $object->getId()); $st->bindValue(":DateFrom", $dateFrom ? $dateFrom->format("Y-m-d H:i:s.u") : null); $st->bindValue(":DateTo", $dateTo ? $dateTo->format("Y-m-d H:i:s.u") : null); $st->bindValue(":CalcPeriod", $calcPeriod); $st->execute(); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { // $this->object = $this->object = \Billing\Core::getEm()->find('Billing\Domain\ServiceAccount', 742286); $this->object = $this->object = \Billing\Core::getEm()->find('Billing\\Domain\\ServiceAccount', 44); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this->object = $this->object = \Billing\Core::getEm()->find('Billing\\Domain\\TVEIpTVChannel', 653); }
/** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp() { $this->object = new ClientGroup(); $this->object = \Billing\Core::getEm()->find('Billing\\Domain\\ClientGroup', 8); }
<?php namespace Billing; use Zend\Config\Config; date_default_timezone_set("Etc/GMT-5"); //Logger::getRootLogger()->debug(PHP_OS); //define('APPLICATION_PATH', __DIR__); //define('LIB_PATH', __DIR__."/../lib"); require_once __DIR__ . '/../vendor/autoload.php'; \Doctrine\Common\Annotations\AnnotationRegistry::registerFile(__DIR__ . '/../vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'); Core::configureDefault((new Config(require __DIR__ . "/config.php"))->billing); \Page\View\ViewManager::setViewClass('Billing\\Subscriber', 'Billing\\View\\SubscriberView');
public function getStatus() { $st = Core::getEm()->getConnection()->prepare("select planneddebtorsrollcall.dbo.getServiceAccountStatus (:id)"); $st->bindValue(":id", $this->_id); $st->execute(); $result = $st->fetchColumn(); return (int) $result; }
function testAdd() { $object = \Billing\Core::getEm()->find('Billing\\Domain\\TVEIpTVChannel', 653); $account = \Billing\Core::getEm()->find('Billing\\Domain\\Account', 732663); ServiceAccountPeriodObject::add($object, $account); }