/** * @param LifecycleEventArgs $args * @param bool $remove */ protected function update(LifecycleEventArgs $args, $remove) { $alias = $this->builder->getEntityAlias($args->getEntity()); $this->keeper->set($alias, new \DateTime()); if ($this->track_individually_entity) { $ids = $this->builder->getEntityIdentifier($args->getEntity()); if ($ids !== null) { if ($remove) { $this->keeper->remove($alias . $ids); } else { $this->keeper->set($alias . $ids, new \DateTime()); } } } }
/** * @param InputInterface $input * @param OutputInterface $output * * @return int|null */ protected function execute(InputInterface $input, OutputInterface $output) { $this->keeper->set(Keeper::LAST_UPDATE_KEY, new \DateTime()); $output->writeln('Reset last update date of the project is complete.'); }
/** * @param ConsoleTerminateEvent $event */ public function onTerminate(ConsoleTerminateEvent $event) { if ($this->track_clear_cache && $event->getCommand()->getName() == 'cache:clear') { $this->keeper->set(Keeper::LAST_UPDATE_KEY, new \DateTime()); } }
public function testSet() { $this->driver->expects($this->once())->method('set')->with('foo', $this->time)->will($this->returnValue(true)); $this->assertTrue($this->keeper->set('foo', $this->time)); }