public function findAll($pid = -1) { if ($pid > 0) { $this->setStoragePid($pid); } return parent::findAll(); }
public function setRemote(RemoteInterface $remote) { if (!$remote instanceof GitHubRemote) { throw new \InvalidArgumentException('Only GitHub remotes are supported for this repository'); } parent::setRemote($remote); }
public function __construct() { parent::__construct(); /** @var $logManager \TYPO3\CMS\Core\Log\LogManager */ $logManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Log\LogManager::class); $this->logger = $logManager->getLogger(__CLASS__); $this->db = $GLOBALS['TYPO3_DB']; }
public function viewMovie($movieId) { $movieView = $this->_movieViewRepository->findOneBy(array('id' => $movieId)); $movie = $this->_movieRepository->findOneBy(array('id' => $movieId)); if (!$movieView) { $movieView = new MovieView(); $movieView->setId($movie->getId()); $movieView->setViewCount($movie->getViewCount()); $this->_em->persist($movieView); $this->_em->flush($movieView); $this->_movieRepository->clear(); } $movieView->setViewCount($movieView->getViewCount() + 1); $rnd = rand(0, 100); if ($rnd < $this->_updateViewCountRatio) { $movie->setViewCount($movieView->getViewCount()); } $this->_updateMovieUrl($movieId, $rnd); }
public function createQuery() { $query = parent::createQuery(); $objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class); $configurationManager = $objectManager->get(\TYPO3\CMS\Extbase\Configuration\ConfigurationManager::class); $storagePid = $configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS, 'newsletter', 'storagePid'); if ($storagePid['storagePid']) { $query->getQuerySettings()->setRespectStoragePage(true); } return $query; }
/** * Gets identifier value for required object * * @param object $object An entity * @return string|null Returns identifier value or null if repository isn't provided. */ public function getIdentifierValue($object) { if ($this->repos !== null) { $value = ''; foreach ((array) $this->repos->getIdentifier() as $property) { if (property_exists($object, $property)) { $value .= "," . (string) $object->{$property}; } else { $fn = 'get' . ucfirst($property); $value .= "," . (string) $object->{$fn}(); } } $value = $value !== '' ? substr($value, 1) . '' : ''; } else { $value = null; } return $value; }
/** * Construct a new package repository. * * @param array $packageData The raw package data. * @param array<string,mixed>|null $options The repository options. * @param mixed $rawData The raw data describing the repository. */ public function __construct(array $packageData, array $options = null, $rawData = null) { parent::__construct('package', $options, $rawData); $this->packageData = $packageData; }
/** * Returns hash string generated based on current repository state * * @return string */ public function getHash() { return $this->repository->getHash(); }
/** * Construct a new repository. * * @param string $type The repository type. * @param string|null $uri The repository URI. * @param array<string,mixed>|null $options The repository options. * @param mixed $rawData The raw data describing the repository. */ public function __construct($type, $uri = null, array $options = null, $rawData = null) { parent::__construct($type, $options, $rawData); $this->uri = $uri; }
/** * Initialize Object */ public function initializeObject() { parent::initializeObject(); $this->objectType = 'Abra\\Cadabra\\Domain\\Model\\Attribute\\AbstractAttribute'; }