/** * @param GoogleConnection $connection * * @return Model; */ public function entityToModel(GoogleConnection $connection) { $model = new Model(); $model->setId($connection->getId())->setTitle($connection->getTitle())->setClientId($connection->getClientId())->setClientSecret($connection->getClientSecret())->setProjectId($connection->getProjectId())->setProjectId($connection->getProjectId())->setInternalId($connection->getInternalId())->setJobDayComplete($connection->isJobDayComplete())->setNurseryDayComplete($connection->isNurseryDayComplete())->setActive($connection->isActive()); return $model; }
/** * @param GoogleConnection $connection * @param JobCalendar $model * * @return GoogleLink */ private function getGoogleLink(GoogleConnection $connection, JobCalendar $model) { return $this->manager->getRepository('AppBundle:GoogleLink')->findOneBy(['connectionId' => $connection->getId(), 'type' => Calendar::EVENT_TYPE_JOB, 'calendarId' => $model->getCalendar()->getId(), 'internalId' => $model->getId()]); }
/** * @param GoogleConnection $connection * * @return string */ private function getAuthConfig(GoogleConnection $connection) { return json_encode(['installed' => ['client_id' => $connection->getClientId(), 'project_id' => $connection->getProjectId(), 'auth_uri' => 'https://accounts.google.com/o/oauth2/auth', 'token_uri' => 'https://accounts.google.com/o/oauth2/token', 'auth_provider_x509_cert_url' => 'https://www.googleapis.com/oauth2/v1/certs', 'client_secret' => $connection->getClientSecret(), 'redirect_uris' => ['urn:ietf:wg:oauth:2.0:oob', 'http://localhost']]]); }