Retire this project
The upstream for this project has moved to github. Retire the opendev repo to avoid any confusion. Depends-On: https://review.opendev.org/c/openstack/project-config/+/818170 Change-Id: I0e7f14701a75c4cceb76c80d2584534ddbd45f58
This commit is contained in:
parent
954e445fda
commit
7ae2662876
179
.env.example
179
.env.example
@ -1,179 +0,0 @@
|
||||
APP_ENV=local
|
||||
APP_DEBUG=true
|
||||
APP_DEBUG_EMAIL=
|
||||
APP_KEY=SomeRandomString
|
||||
APP_URL=http://localhost
|
||||
APP_SCOPE_BASE_REALM=http://localhost
|
||||
APP_OAUTH_2_0_CLIENT_ID=clientid
|
||||
APP_OAUTH_2_0_CLIENT_SECRET=clientsecret
|
||||
APP_OAUTH_2_0_AUTH_SERVER_BASE_URL=http://localhost
|
||||
|
||||
DB_HOST=localhost
|
||||
DB_DATABASE=homestead
|
||||
DB_USERNAME=homestead
|
||||
DB_PASSWORD=secret
|
||||
|
||||
SS_DB_HOST=localhost
|
||||
SS_DB_DATABASE=homestead
|
||||
SS_DB_USERNAME=homestead
|
||||
SS_DB_PASSWORD=secret
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PORT=port
|
||||
REDIS_DB=0
|
||||
REDIS_PASSWORD=
|
||||
|
||||
CACHE_DRIVER=file
|
||||
|
||||
SESSION_DRIVER=redis
|
||||
SESSION_COOKIE_DOMAIN=
|
||||
SESSION_COOKIE_SECURE=false
|
||||
|
||||
QUEUE_DRIVER=database
|
||||
QUEUE_CONN=
|
||||
QUEUE_DATABASE=
|
||||
|
||||
MAIL_DRIVER=sendgrid
|
||||
SENDGRID_API_KEY='YOUR_SENDGRID_API_KEY'
|
||||
|
||||
CORS_ALLOWED_HEADERS=origin, content-type, accept, authorization, x-requested-with
|
||||
CORS_ALLOWED_METHODS=GET, POST, OPTIONS, PUT, DELETE
|
||||
CORS_USE_PRE_FLIGHT_CACHING=true
|
||||
CORS_MAX_AGE=3200
|
||||
CORS_EXPOSED_HEADERS=
|
||||
|
||||
CURL_TIMEOUT=3600
|
||||
CURL_ALLOWS_REDIRECT=false
|
||||
CURL_VERIFY_SSL_CERT=false
|
||||
|
||||
ASSETS_BASE_URL=http://www.openstack.org
|
||||
SSL_ENABLED=true
|
||||
DB_LOG_ENABLED=true
|
||||
ACCESS_TOKEN_CACHE_LIFETIME=300
|
||||
API_RESPONSE_CACHE_LIFETIME=600
|
||||
|
||||
LOG_EMAIL_TO=smarcet@gmail.com
|
||||
LOG_EMAIL_FROM=smarcet@gmail.com
|
||||
LOG_LEVEL=debug
|
||||
|
||||
EVENTBRITE_OAUTH2_PERSONAL_TOKEN=
|
||||
SS_ENCRYPT_KEY=
|
||||
SS_ENCRYPT_CYPHER=AES-256-CBC
|
||||
|
||||
GOOGLE_CLIENT_ID=""
|
||||
GOOGLE_CLIENT_SECRET=""
|
||||
GOOGLE_SCOPES=""
|
||||
|
||||
SSH_USER=
|
||||
SSH_PUBLIC_KEY=
|
||||
SSH_PRIVATE_KEY=
|
||||
SCP_HOST=
|
||||
SCP_REMOTE_BASE_PATH=/tmp
|
||||
|
||||
GOOGLE_GEO_CODING_API_KEY=
|
||||
|
||||
# swift configuration
|
||||
CLOUD_STORAGE_AUTH_URL=
|
||||
CLOUD_STORAGE_USERNAME=
|
||||
CLOUD_STORAGE_APIKEY=
|
||||
CLOUD_STORAGE_PROJECT_NAME=
|
||||
CLOUD_STORAGE_REGION=
|
||||
CLOUD_STORAGE_ASSETS_CONTAINER=
|
||||
CLOUD_STORAGE_IMAGES_CONTAINER=
|
||||
CLOUD_STORAGE_MEDIA_UPLOADS_CONTAINER=
|
||||
# enable/disable cal sync background task
|
||||
ENABLE_CAL_SYNC=true
|
||||
# enable/disable bookable rooms reservation revocation task
|
||||
ENABLE_BOOKABLE_ROOMS_RESERVATION_REVOCATION=false
|
||||
|
||||
MAIL_FROM_NAME=
|
||||
MAIL_FROM_EMAIL=
|
||||
|
||||
#stripe
|
||||
|
||||
STRIPE_BOOKING_PRIVATE_KEY=
|
||||
STRIPE_BOOKING_ENDPOINT_SECRET=
|
||||
STRIPE_REGISTRATION_PRIVATE_KEY=
|
||||
STRIPE_REGISTRATION_ENDPOINT_SECRET=
|
||||
|
||||
#registration
|
||||
REGISTRATION_SERVICE_OAUTH2_CLIENT_ID=
|
||||
REGISTRATION_SERVICE_OAUTH2_CLIENT_SECRET=
|
||||
REGISTRATION_SERVICE_OAUTH2_SCOPES=
|
||||
REGISTRATION_DASHBOARD_OAUTH2_CLIENT_ID=
|
||||
REGISTRATION_FROM_EMAIL=
|
||||
REGISTRATION_DASHBOARD_BASE_URL=
|
||||
REGISTRATION_DASHBOARD_BACK_URL=%s/a/orders
|
||||
REGISTRATION_DASHBOARD_INVITATION_FORM_URL=%s/a/invitations/%s
|
||||
REGISTRATION_DASHBOARD_ATTENDEE_EDIT_FORM_URL=%s/a/guests/%s
|
||||
REGISTRATION_REMINDER_EMAIL_DAYS_INTERVAL=7
|
||||
REGISTRATION_SUPPORT_EMAIL=
|
||||
#IDP
|
||||
# CHECK /.well-known/openid-configuration at idp
|
||||
IDP_BASE_URI=
|
||||
IDP_AUTHORIZATION_ENDPOINT=
|
||||
IDP_TOKEN_ENDPOINT=
|
||||
IDP_INTROSPECTION_ENDPOINT=
|
||||
IDP_USERINFO_ENDPOINT=
|
||||
|
||||
REGISTRATION_VALIDATE_TICKET_TYPE_REMOVAL=true
|
||||
|
||||
# default stripe config
|
||||
# if not set at summit level this will be used ( if set by default)
|
||||
# *_WEBHOOK_SECRET variables should be populated by manually created webhooks at set stripe account
|
||||
# and should be pointed to $API_BASE_URL/api/public/v1/summits/all/payments/Registration/confirm
|
||||
# and set to attended following events types
|
||||
# * payment_intent.payment_failed
|
||||
# payment_intent.succeeded
|
||||
|
||||
REGISTRATION_DEFAULT_PAYMENT_PROVIDER=Stripe
|
||||
REGISTRATION_DEFAULT_STRIPE_TEST_MODE=
|
||||
REGISTRATION_DEFAULT_LIVE_STRIPE_PRIVATE_KEY=
|
||||
REGISTRATION_DEFAULT_LIVE_STRIPE_PUBLISHABLE_KEY=
|
||||
REGISTRATION_DEFAULT_LIVE_WEBHOOK_SECRET=
|
||||
REGISTRATION_DEFAULT_TEST_STRIPE_PRIVATE_KEY=
|
||||
REGISTRATION_DEFAULT_TEST_STRIPE_PUBLISHABLE_KEY=
|
||||
REGISTRATION_DEFAULT_TEST_WEBHOOK_SECRET=
|
||||
|
||||
BOOKABLE_ROOMS_DEFAULT_PAYMENT_PROVIDER=Stripe
|
||||
BOOKABLE_ROOMS_DEFAULT_STRIPE_TEST_MODE=
|
||||
BOOKABLE_ROOMS_DEFAULT_LIVE_STRIPE_PRIVATE_KEY=
|
||||
BOOKABLE_ROOMS_DEFAULT_LIVE_STRIPE_PUBLISHABLE_KEY=
|
||||
BOOKABLE_ROOMS_DEFAULT_LIVE_WEBHOOK_SECRET=
|
||||
BOOKABLE_ROOMS_DEFAULT_TEST_STRIPE_PRIVATE_KEY=
|
||||
BOOKABLE_ROOMS_DEFAULT_TEST_STRIPE_PUBLISHABLE_KEY=
|
||||
BOOKABLE_ROOMS_DEFAULT_TEST_WEBHOOK_SECRET=
|
||||
|
||||
MAIL_API_BASE_URL=
|
||||
MAIL_API_OAUTH2_CLIENT_ID=
|
||||
MAIL_API_OAUTH2_CLIENT_SECRET=
|
||||
MAIL_API_OAUTH2_CLIENT_SCOPES=
|
||||
|
||||
CFP_APP_BASE_URL=
|
||||
CFP_SUPPORT_EMAIL=
|
||||
|
||||
## RABBIT MQ
|
||||
RABBITMQ_EXCHANGE_NAME=databus-exchange
|
||||
RABBITMQ_HOST=
|
||||
RABBITMQ_PORT=5671
|
||||
RABBITMQ_VHOST=databus
|
||||
RABBITMQ_LOGIN=admin
|
||||
RABBITMQ_PASSWORD=1qaz2wsx
|
||||
RABBITMQ_QUEUE=default
|
||||
RABBITMQ_SSL=true
|
||||
RABBITMQ_SSL_CAFILE=/certs/rabbit/ca-osf.pem
|
||||
RABBITMQ_SSL_LOCALCERT=/certs/rabbit/client-cert-osf.pem
|
||||
RABBITMQ_SSL_LOCALKEY=/certs/rabbit/client-key-osf.pem
|
||||
RABBITMQ_SSL_VERIFY_PEER=false
|
||||
|
||||
DROPBOX_ACCESS_TOKEN=
|
||||
|
||||
MUX_TOKEN_ID=
|
||||
MUX_TOKEN_SECRET=
|
||||
|
||||
# S3
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=
|
||||
AWS_BUCKET=
|
||||
AWS_ENDPOINT=
|
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -1,3 +0,0 @@
|
||||
* text=auto
|
||||
*.css linguist-vendored
|
||||
*.less linguist-vendored
|
30
.gitignore
vendored
30
.gitignore
vendored
@ -1,30 +0,0 @@
|
||||
/vendor
|
||||
/node_modules
|
||||
composer.phar
|
||||
.DS_Storeapp/storage
|
||||
.idea/*
|
||||
app/config/dev/*
|
||||
app/config/testing/*
|
||||
app/config/local/*
|
||||
app/config/production/*
|
||||
app/config/staging/*
|
||||
app/config/packages/greggilbert/recaptcha/dev/*
|
||||
app/config/packages/greggilbert/recaptcha/local/*
|
||||
app/config/packages/greggilbert/recaptcha/production/*
|
||||
app/config/packages/greggilbert/recaptcha/staging/*
|
||||
/bootstrap/compiled.php
|
||||
/bootstrap/environment.php
|
||||
.tox
|
||||
AUTHORS
|
||||
ChangeLog
|
||||
doc/build
|
||||
*.egg
|
||||
*.egg-info
|
||||
.env.testing
|
||||
.env
|
||||
storage/*
|
||||
*.log
|
||||
routes.txt
|
||||
/storage/logs/
|
||||
/ss.sql
|
||||
phpunit.xml
|
@ -1,4 +1,4 @@
|
||||
[gerrit]
|
||||
host=review.opendev.org
|
||||
port=29418
|
||||
project=osf/openstackid-resources.git
|
||||
project=openinfra/openstackid-resources.git
|
||||
|
@ -1,311 +0,0 @@
|
||||
<?php namespace Libs\ModelSerializers;
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use libs\utils\JsonUtils;
|
||||
use models\oauth2\IResourceServerContext;
|
||||
use models\utils\IEntity;
|
||||
use ModelSerializers\SerializerRegistry;
|
||||
|
||||
/**
|
||||
* Class AbstractSerializer
|
||||
* @package Libs\ModelSerializers
|
||||
*/
|
||||
abstract class AbstractSerializer implements IModelSerializer
|
||||
{
|
||||
const MaxCollectionPage = 10;
|
||||
/**
|
||||
* @var IEntity
|
||||
*/
|
||||
protected $object;
|
||||
|
||||
/**
|
||||
* @var IResourceServerContext
|
||||
*/
|
||||
protected $resource_server_context;
|
||||
|
||||
/**
|
||||
* AbstractSerializer constructor.
|
||||
* @param $object
|
||||
* @param IResourceServerContext $resource_server_context
|
||||
*/
|
||||
public function __construct($object, IResourceServerContext $resource_server_context){
|
||||
$this->object = $object;
|
||||
$this->resource_server_context = $resource_server_context;
|
||||
}
|
||||
|
||||
protected static $array_mappings = [];
|
||||
|
||||
protected static $allowed_fields = [];
|
||||
|
||||
protected static $allowed_relations = [];
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getAllowedFields()
|
||||
{
|
||||
$mappings = [];
|
||||
$hierarchy = $this->getClassHierarchy();
|
||||
|
||||
foreach($hierarchy as $class_name){
|
||||
if($class_name === 'Libs\ModelSerializers\AbstractSerializer') continue;
|
||||
$class = new $class_name($this->object, $this->resource_server_context);
|
||||
$mappings = array_merge($mappings, $class->getSelfAllowedFields());
|
||||
}
|
||||
$mappings = array_merge($mappings, $this->getSelfAllowedFields());
|
||||
return $mappings;
|
||||
}
|
||||
|
||||
private function getSelfAllowedFields(){
|
||||
return static::$allowed_fields;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function getAllowedRelations()
|
||||
{
|
||||
$mappings = array();
|
||||
$hierarchy = $this->getClassHierarchy();
|
||||
|
||||
foreach($hierarchy as $class_name){
|
||||
if($class_name === 'Libs\ModelSerializers\AbstractSerializer') continue;
|
||||
$class = new $class_name($this->object, $this->resource_server_context);
|
||||
$mappings = array_merge($mappings, $class->getSelfAllowedRelations());
|
||||
}
|
||||
$mappings = array_merge($mappings, $this->getSelfAllowedRelations());
|
||||
return $mappings;
|
||||
}
|
||||
|
||||
private function getSelfAllowedRelations(){
|
||||
return static::$allowed_relations;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getAttributeMappings()
|
||||
{
|
||||
$mappings = [];
|
||||
$hierarchy = $this->getClassHierarchy();
|
||||
|
||||
foreach($hierarchy as $class_name){
|
||||
if($class_name === 'Libs\ModelSerializers\AbstractSerializer') continue;
|
||||
$class = new $class_name($this->object, $this->resource_server_context);
|
||||
$mappings = array_merge($mappings, $class->getSelfMappings());
|
||||
}
|
||||
$mappings = array_merge($mappings, $this->getSelfMappings());
|
||||
return $mappings;
|
||||
}
|
||||
|
||||
private function getSelfMappings(){
|
||||
return static::$array_mappings;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getClassHierarchy(){
|
||||
return array_reverse($this->get_class_lineage($this));
|
||||
}
|
||||
|
||||
private function get_class_lineage($object)
|
||||
{
|
||||
$class_name = get_class($object);
|
||||
$parents = array_values(class_parents($class_name));
|
||||
return array_merge(array($class_name), $parents);
|
||||
}
|
||||
|
||||
const BoolType = 'json_boolean';
|
||||
const EpochType = 'datetime_epoch';
|
||||
const StringType = 'json_string';
|
||||
const IntType = 'json_int';
|
||||
const FloatType = 'json_float';
|
||||
const ObfuscatedEmailType = 'json_obfuscated_email';
|
||||
const UrlType = 'json_url';
|
||||
const ColorType = 'json_color';
|
||||
|
||||
const ValidTypes = [
|
||||
self::BoolType,
|
||||
self::EpochType,
|
||||
self::StringType,
|
||||
self::IntType,
|
||||
self::FloatType,
|
||||
self::ObfuscatedEmailType,
|
||||
self::UrlType,
|
||||
self::ColorType,
|
||||
];
|
||||
|
||||
/**
|
||||
* @param string $field
|
||||
* @param string $type
|
||||
* @return string
|
||||
*/
|
||||
public static function buildMapping(string $field, string $type):string {
|
||||
if(!in_array($type, self::ValidTypes))
|
||||
throw new \InvalidArgumentException();
|
||||
return sprintf("%s:%s", $field, $type);
|
||||
}
|
||||
|
||||
protected $expand_mappings = [];
|
||||
|
||||
/**
|
||||
* @param null $expand
|
||||
* @param array $fields
|
||||
* @param array $relations
|
||||
* @param array $params
|
||||
* @return array
|
||||
*/
|
||||
public function serialize($expand = null, array $fields = [], array $relations = [], array $params = [])
|
||||
{
|
||||
$values = [];
|
||||
$method_prefix = ['get', 'is'];
|
||||
if(!count($fields)) $fields = $this->getAllowedFields();
|
||||
$mappings = $this->getAttributeMappings();
|
||||
if (count($mappings)) {
|
||||
$new_values = [];
|
||||
foreach ($mappings as $attribute => $mapping) {
|
||||
$mapping = preg_split('/:/', $mapping);
|
||||
if(count($fields) > 0 && !in_array($mapping[0], $fields)) continue;
|
||||
$value = null;
|
||||
$method_found = false;
|
||||
foreach($method_prefix as $prefix){
|
||||
if(method_exists($this->object, $prefix.$attribute)){
|
||||
try {
|
||||
$value = call_user_func([$this->object, $prefix . $attribute]);
|
||||
$method_found = true;
|
||||
break;
|
||||
}
|
||||
catch (\Exception $ex){
|
||||
Log::warning($ex);
|
||||
$value = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!$method_found){
|
||||
try {
|
||||
//try dynamic one
|
||||
$value = call_user_func([$this->object, 'get'.$attribute ]);
|
||||
}
|
||||
catch (\Exception $ex){
|
||||
Log::warning($ex);
|
||||
$value = null;
|
||||
}
|
||||
}
|
||||
|
||||
if(count($mapping) > 1)
|
||||
{
|
||||
//we have a formatter ...
|
||||
switch(strtolower($mapping[1]))
|
||||
{
|
||||
case 'datetime_epoch':
|
||||
{
|
||||
if(!is_null($value)) {
|
||||
$value = $value->getTimestamp();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'json_string':
|
||||
{
|
||||
$value = JsonUtils::toJsonString($value);
|
||||
}
|
||||
break;
|
||||
case 'json_boolean':
|
||||
{
|
||||
$value = JsonUtils::toJsonBoolean($value);
|
||||
}
|
||||
break;
|
||||
case 'json_color':
|
||||
{
|
||||
$value = JsonUtils::toJsonColor($value);
|
||||
}
|
||||
break;
|
||||
case 'json_int':
|
||||
{
|
||||
$value = JsonUtils::toJsonInt($value);
|
||||
}
|
||||
break;
|
||||
case 'json_float':
|
||||
{
|
||||
$value = JsonUtils::toJsonFloat($value);
|
||||
}
|
||||
break;
|
||||
case 'json_obfuscated_email':
|
||||
{
|
||||
$value = JsonUtils::toObfuscatedEmail($value);
|
||||
}
|
||||
case 'json_url':{
|
||||
$value = JsonUtils::encodeUrl($value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
$new_values[$mapping[0]] = $value;
|
||||
}
|
||||
$values = $new_values;
|
||||
}
|
||||
|
||||
// expand logic
|
||||
if (!empty($expand)) {
|
||||
$exp_expand = explode(',', $expand);
|
||||
foreach ($exp_expand as $relation) {
|
||||
$relation = trim($relation);
|
||||
if(isset($this->expand_mappings[$relation])){
|
||||
$values = $this->expand_mappings[$relation]->serialize($values, $expand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $expand_str
|
||||
* @param string $prefix
|
||||
* @return string
|
||||
*/
|
||||
public static function filterExpandByPrefix($expand_str, $prefix){
|
||||
|
||||
$expand_to = explode(',', $expand_str);
|
||||
$filtered_expand = array_filter($expand_to, function($element) use($prefix){
|
||||
return preg_match('/^' . preg_quote($prefix, '/') . '\./', strtolower(trim($element))) > 0;
|
||||
});
|
||||
$res = '';
|
||||
foreach($filtered_expand as $filtered_expand_elem){
|
||||
if(strlen($res) > 0) $res .= ',';
|
||||
$res .= str_replace_first($prefix.".","", strtolower(trim($filtered_expand_elem)));
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prefix
|
||||
* @param string $expand
|
||||
* @return string
|
||||
*/
|
||||
protected static function getExpandForPrefix(string $prefix, string $expand):string {
|
||||
|
||||
Log::debug(sprintf("AbstractSerializer::getExpandForPrefix prefix %s expand %s", $prefix, $expand));
|
||||
|
||||
$prefix_expand = [];
|
||||
foreach(explode(',', $expand) as $e){
|
||||
if(strstr($e, $prefix.".")!==false)
|
||||
$prefix_expand[] = str_replace($prefix.".","", $e);
|
||||
}
|
||||
|
||||
return implode(',', $prefix_expand);
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
<?php namespace Libs\ModelSerializers;
|
||||
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
interface IModelSerializer
|
||||
{
|
||||
/**
|
||||
* @param null $expand
|
||||
* @param array $fields
|
||||
* @param array $relations
|
||||
* @param array $params
|
||||
* @return array
|
||||
* @throw HTTP403ForbiddenException
|
||||
*/
|
||||
public function serialize($expand = null, array $fields = array(), array $relations = array(), array $params = array() );
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
<?php namespace Libs\ModelSerializers;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use ModelSerializers\SerializerRegistry;
|
||||
/**
|
||||
* Class Many2OneExpandSerializer
|
||||
* @package Libs\ModelSerializers
|
||||
*/
|
||||
class Many2OneExpandSerializer extends One2ManyExpandSerializer
|
||||
{
|
||||
/**
|
||||
* @param array $values
|
||||
* @param string $expand
|
||||
* @return array
|
||||
*/
|
||||
public function serialize(array $values, string $expand): array
|
||||
{
|
||||
$values = $this->unsetOriginalAttribute($values);
|
||||
$callback = $this->getRelationFn;
|
||||
$res = [];
|
||||
foreach ($callback($this) as $item){
|
||||
$res[] = SerializerRegistry::getInstance()->getSerializer($item)->serialize(AbstractSerializer::filterExpandByPrefix($expand, $this->attribute_name));
|
||||
}
|
||||
$values[$this->attribute_name] = $res;
|
||||
return $values;
|
||||
}
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
<?php namespace Libs\ModelSerializers;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use ModelSerializers\SerializerRegistry;
|
||||
use Closure;
|
||||
/**
|
||||
* Class One2ManyExpandSerializer
|
||||
* @package Libs\ModelSerializers
|
||||
*/
|
||||
class One2ManyExpandSerializer
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $original_attribute;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $attribute_name;
|
||||
|
||||
/**
|
||||
* @var Closure
|
||||
*/
|
||||
protected $getRelationFn;
|
||||
|
||||
/**
|
||||
* One2ManyExpandSerializer constructor.
|
||||
* @param string $attribute_name
|
||||
* @param Closure $getRelationFn
|
||||
* @param string|null $original_attribute
|
||||
*/
|
||||
public function __construct(
|
||||
string $attribute_name,
|
||||
Closure $getRelationFn,
|
||||
string $original_attribute = null
|
||||
)
|
||||
{
|
||||
$this->attribute_name = $attribute_name;
|
||||
$this->getRelationFn = $getRelationFn;
|
||||
$this->original_attribute = $original_attribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $values
|
||||
* @return array
|
||||
*/
|
||||
protected function unsetOriginalAttribute(array $values)
|
||||
{
|
||||
if (isset($values[$this->original_attribute]))
|
||||
unset($values[$this->original_attribute]);
|
||||
return $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $values
|
||||
* @param string $expand
|
||||
* @return array
|
||||
*/
|
||||
public function serialize(array $values, string $expand): array
|
||||
{
|
||||
$values = $this->unsetOriginalAttribute($values);
|
||||
$callback = $this->getRelationFn;
|
||||
$values[$this->attribute_name] = SerializerRegistry::getInstance()->getSerializer($callback($this))->serialize(AbstractSerializer::filterExpandByPrefix($expand, $this->attribute_name));
|
||||
return $values;
|
||||
}
|
||||
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class BearerAccessTokenAuthorizationHeaderParser
|
||||
* Parse
|
||||
* http://tools.ietf.org/html/rfc6750#section-2-1
|
||||
* @package oauth2
|
||||
*/
|
||||
class BearerAccessTokenAuthorizationHeaderParser
|
||||
{
|
||||
|
||||
private static $instance = null;
|
||||
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
if (self::$instance == null)
|
||||
{
|
||||
self::$instance = new BearerAccessTokenAuthorizationHeaderParser();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $http_auth_header_value
|
||||
* @return string
|
||||
* @throws OAuth2MissingBearerAccessTokenException
|
||||
*/
|
||||
public function parse($http_auth_header_value)
|
||||
{
|
||||
$accessTokenValue = '';
|
||||
if (!is_null($http_auth_header_value) && !empty($http_auth_header_value))
|
||||
{
|
||||
// Check for special case, because cURL sometimes does an
|
||||
// internal second request and doubles the authorization header,
|
||||
// which always resulted in an error.
|
||||
//
|
||||
// 1st request: Authorization: Bearer XXX
|
||||
// 2nd request: Authorization: Bearer XXX, Bearer XXX
|
||||
if (strpos($http_auth_header_value, ',') !== false)
|
||||
{
|
||||
$headerPart = explode(',', $http_auth_header_value);
|
||||
$accessTokenValue = trim(preg_replace('/^(?:\s+)?Bearer\s/', '', $headerPart[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
$accessTokenValue = trim(preg_replace('/^(?:\s+)?Bearer\s/', '', $http_auth_header_value));
|
||||
}
|
||||
$accessTokenValue = ($accessTokenValue == 'Bearer') ? '' : $accessTokenValue;
|
||||
}
|
||||
if (empty($accessTokenValue))
|
||||
{
|
||||
throw new OAuth2MissingBearerAccessTokenException;
|
||||
}
|
||||
return $accessTokenValue;
|
||||
}
|
||||
|
||||
private function __clone()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
class HttpMessage implements \ArrayAccess
|
||||
{
|
||||
|
||||
protected $container = array();
|
||||
|
||||
public function __construct(array $values)
|
||||
{
|
||||
$this->container = $values;
|
||||
}
|
||||
|
||||
/**
|
||||
* arrayaccess methods
|
||||
* */
|
||||
public function offsetSet($offset, $value)
|
||||
{
|
||||
if (is_null($offset))
|
||||
{
|
||||
$this->container[] = $value;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->container[$offset] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
public function offsetExists($offset)
|
||||
{
|
||||
return isset($this->container[$offset]);
|
||||
}
|
||||
|
||||
public function offsetUnset($offset)
|
||||
{
|
||||
unset($this->container[$offset]);
|
||||
}
|
||||
|
||||
public function offsetGet($offset)
|
||||
{
|
||||
return isset($this->container[$offset]) ? $this->container[$offset] : null;
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
abstract class HttpResponse extends HttpMessage
|
||||
{
|
||||
const HttpOkResponse = 200;
|
||||
const HttpErrorResponse = 400;
|
||||
|
||||
protected $http_code;
|
||||
protected $content_type;
|
||||
|
||||
public function __construct($http_code, $content_type)
|
||||
{
|
||||
$this->http_code = $http_code;
|
||||
$this->content_type = $content_type;
|
||||
}
|
||||
|
||||
abstract public function getContent();
|
||||
|
||||
public function getHttpCode()
|
||||
{
|
||||
return $this->http_code;
|
||||
}
|
||||
|
||||
protected function setHttpCode($http_code)
|
||||
{
|
||||
$this->http_code = $http_code;
|
||||
}
|
||||
|
||||
public function getContentType()
|
||||
{
|
||||
return $this->content_type;
|
||||
}
|
||||
|
||||
abstract public function getType();
|
||||
|
||||
public function addParam($name, $value)
|
||||
{
|
||||
$this[$name] = $value;
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class InvalidGrantTypeException
|
||||
* @package libs\oauth2
|
||||
*/
|
||||
class InvalidGrantTypeException extends Exception
|
||||
{
|
||||
public function __construct($message = "")
|
||||
{
|
||||
$message = "Invalid Grant Type : " . $message;
|
||||
parent::__construct($message, 0, null);
|
||||
}
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
|
||||
class OAuth2DirectResponse extends OAuth2Response
|
||||
{
|
||||
|
||||
const DirectResponseContentType = "application/json;charset=UTF-8";
|
||||
const OAuth2DirectResponse = 'OAuth2DirectResponse';
|
||||
|
||||
public function __construct($http_code = self::HttpOkResponse, $content_type = self::DirectResponseContentType)
|
||||
{
|
||||
// Successful Responses: A server receiving a valid request MUST send a
|
||||
// response with an HTTP status code of 200.
|
||||
parent::__construct($http_code, $content_type);
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$json_encoded_format = json_encode($this->container);
|
||||
return $json_encoded_format;
|
||||
}
|
||||
|
||||
public function getType()
|
||||
{
|
||||
return self::OAuth2DirectResponse;
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use \Exception;
|
||||
|
||||
class OAuth2InvalidIntrospectionResponse extends Exception
|
||||
{
|
||||
public function __construct($message = "")
|
||||
{
|
||||
$message = "Invalid Introspection Response : " . $message;
|
||||
parent::__construct($message, 0, null);
|
||||
}
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class OAuth2MissingBearerAccessTokenException
|
||||
* @package libs\oauth2
|
||||
*/
|
||||
class OAuth2MissingBearerAccessTokenException extends Exception
|
||||
{
|
||||
public function __construct($message = "")
|
||||
{
|
||||
$message = "Missing Bearer Access Token : " . $message;
|
||||
parent::__construct($message, 0, null);
|
||||
}
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
class OAuth2Protocol
|
||||
{
|
||||
|
||||
const OAuth2Protocol_GrantType_AuthCode = 'authorization_code';
|
||||
const OAuth2Protocol_GrantType_Implicit = 'implicit';
|
||||
const OAuth2Protocol_GrantType_ResourceOwner_Password = 'password';
|
||||
const OAuth2Protocol_GrantType_ClientCredentials = 'client_credentials';
|
||||
const OAuth2Protocol_GrantType_RefreshToken = 'refresh_token';
|
||||
const OAuth2Protocol_ResponseType_Code = 'code';
|
||||
const OAuth2Protocol_ResponseType_Token = 'token';
|
||||
const OAuth2Protocol_ResponseType = 'response_type';
|
||||
const OAuth2Protocol_ClientId = 'client_id';
|
||||
const OAuth2Protocol_UserId = 'user_id';
|
||||
const OAuth2Protocol_ClientSecret = 'client_secret';
|
||||
const OAuth2Protocol_Token = 'token';
|
||||
const OAuth2Protocol_TokenType = 'token_type';
|
||||
//http://tools.ietf.org/html/rfc7009#section-2.1
|
||||
const OAuth2Protocol_TokenType_Hint = 'token_type_hint';
|
||||
const OAuth2Protocol_AccessToken_ExpiresIn = 'expires_in';
|
||||
const OAuth2Protocol_RefreshToken = 'refresh_token';
|
||||
const OAuth2Protocol_AccessToken = 'access_token';
|
||||
const OAuth2Protocol_RedirectUri = 'redirect_uri';
|
||||
const OAuth2Protocol_Scope = 'scope';
|
||||
const OAuth2Protocol_Audience = 'audience';
|
||||
const OAuth2Protocol_State = 'state';
|
||||
/**
|
||||
* Indicates whether the user should be re-prompted for consent. The default is auto,
|
||||
* so a given user should only see the consent page for a given set of scopes the first time
|
||||
* through the sequence. If the value is force, then the user sees a consent page even if they
|
||||
* previously gave consent to your application for a given set of scopes.
|
||||
*/
|
||||
const OAuth2Protocol_Approval_Prompt = 'approval_prompt';
|
||||
const OAuth2Protocol_Approval_Prompt_Force = 'force';
|
||||
const OAuth2Protocol_Approval_Prompt_Auto = 'auto';
|
||||
|
||||
/**
|
||||
* Indicates whether your application needs to access an API when the user is not present at
|
||||
* the browser. This parameter defaults to online. If your application needs to refresh access tokens
|
||||
* when the user is not present at the browser, then use offline. This will result in your application
|
||||
* obtaining a refresh token the first time your application exchanges an authorization code for a user.
|
||||
*/
|
||||
const OAuth2Protocol_AccessType = 'access_type';
|
||||
const OAuth2Protocol_AccessType_Online = 'online';
|
||||
const OAuth2Protocol_AccessType_Offline = 'offline';
|
||||
|
||||
const OAuth2Protocol_GrantType = 'grant_type';
|
||||
const OAuth2Protocol_Error = 'error';
|
||||
const OAuth2Protocol_ErrorDescription = 'error_description';
|
||||
const OAuth2Protocol_ErrorUri = 'error_uri';
|
||||
const OAuth2Protocol_Error_InvalidRequest = 'invalid_request';
|
||||
const OAuth2Protocol_Error_UnauthorizedClient = 'unauthorized_client';
|
||||
const OAuth2Protocol_Error_AccessDenied = 'access_denied';
|
||||
const OAuth2Protocol_Error_UnsupportedResponseType = 'unsupported_response_type';
|
||||
const OAuth2Protocol_Error_InvalidScope = 'invalid_scope';
|
||||
const OAuth2Protocol_Error_UnsupportedGrantType = 'unsupported_grant_type';
|
||||
const OAuth2Protocol_Error_InvalidGrant = 'invalid_grant';
|
||||
//error codes definitions http://tools.ietf.org/html/rfc6749#section-4.1.2.1
|
||||
const OAuth2Protocol_Error_ServerError = 'server_error';
|
||||
const OAuth2Protocol_Error_TemporallyUnavailable = 'temporally_unavailable';
|
||||
//http://tools.ietf.org/html/rfc7009#section-2.2.1
|
||||
const OAuth2Protocol_Error_Unsupported_TokenType = ' unsupported_token_type';
|
||||
//http://tools.ietf.org/html/rfc6750#section-3-1
|
||||
const OAuth2Protocol_Error_InvalidToken = 'invalid_token';
|
||||
const OAuth2Protocol_Error_InsufficientScope = 'insufficient_scope';
|
||||
|
||||
public static $valid_responses_types = array(
|
||||
self::OAuth2Protocol_ResponseType_Code => self::OAuth2Protocol_ResponseType_Code,
|
||||
self::OAuth2Protocol_ResponseType_Token => self::OAuth2Protocol_ResponseType_Token
|
||||
);
|
||||
public static $protocol_definition = array(
|
||||
self::OAuth2Protocol_ResponseType => self::OAuth2Protocol_ResponseType,
|
||||
self::OAuth2Protocol_ClientId => self::OAuth2Protocol_ClientId,
|
||||
self::OAuth2Protocol_RedirectUri => self::OAuth2Protocol_RedirectUri,
|
||||
self::OAuth2Protocol_Scope => self::OAuth2Protocol_Scope,
|
||||
self::OAuth2Protocol_State => self::OAuth2Protocol_State
|
||||
);
|
||||
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class OAuth2ResourceServerException
|
||||
* @package libs\oauth2
|
||||
*/
|
||||
class OAuth2ResourceServerException extends Exception
|
||||
{
|
||||
|
||||
private $http_code;
|
||||
private $error;
|
||||
private $error_description;
|
||||
private $scope;
|
||||
|
||||
public function __construct($http_code, $error, $error_description, $scope = null)
|
||||
{
|
||||
$this->http_code = $http_code;
|
||||
$this->error = $error;
|
||||
$this->error_description = $error_description;
|
||||
$this->scope = $scope;
|
||||
$message = "Resource Server Exception : " . sprintf('http code : %s - error : %s - error description: %s', $http_code, $error, $error_description);
|
||||
parent::__construct($message, 0, null);
|
||||
}
|
||||
|
||||
public function getError()
|
||||
{
|
||||
return $this->error;
|
||||
}
|
||||
|
||||
public function getErrorDescription()
|
||||
{
|
||||
return $this->error_description;
|
||||
}
|
||||
|
||||
public function getScope()
|
||||
{
|
||||
return $this->scope;
|
||||
}
|
||||
|
||||
public function getHttpCode()
|
||||
{
|
||||
return $this->http_code;
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
abstract class OAuth2Response extends HttpResponse
|
||||
{
|
||||
|
||||
}
|
@ -1,71 +0,0 @@
|
||||
<?php namespace libs\oauth2;
|
||||
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Class OAuth2WWWAuthenticateErrorResponse
|
||||
* http://tools.ietf.org/html/rfc6750#section-3
|
||||
* @package oauth2\responses
|
||||
*/
|
||||
class OAuth2WWWAuthenticateErrorResponse extends OAuth2DirectResponse
|
||||
{
|
||||
|
||||
private $realm;
|
||||
private $error;
|
||||
private $error_description;
|
||||
private $scope;
|
||||
private $http_error;
|
||||
|
||||
public function __construct($realm, $error, $error_description, $scope, $http_error)
|
||||
{
|
||||
parent::__construct($http_error, self::DirectResponseContentType);
|
||||
$this->realm = $realm;
|
||||
$this->error = $error;
|
||||
$this->error_description = $error_description;
|
||||
$this->scope = $scope;
|
||||
$this->http_error = $http_error;
|
||||
}
|
||||
|
||||
public function getWWWAuthenticateHeaderValue()
|
||||
{
|
||||
$value = sprintf('Bearer realm="%s"', $this->realm);
|
||||
$value = $value . sprintf(', error="%s"', $this->error);
|
||||
$value = $value . sprintf(', error_description="%s"', $this->error_description);
|
||||
if (!is_null($this->scope)) {
|
||||
$value = $value . sprintf(', scope="%s"', $this->scope);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$content = array(
|
||||
'error' => $this->error,
|
||||
'error_description' => $this->error_description
|
||||
);
|
||||
if (!is_null($this->scope)) {
|
||||
$content['scope'] = $this->scope;
|
||||
}
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function getType()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
<?php namespace libs\utils;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class ConfigurationException
|
||||
* @package libs\utils
|
||||
*/
|
||||
class ConfigurationException extends Exception
|
||||
{
|
||||
|
||||
public function __construct($message = "")
|
||||
{
|
||||
$message = "Configuration Exception : " . $message;
|
||||
parent::__construct($message, 0, null);
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
<?php namespace libs\utils;
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use Doctrine\Common\Persistence\ManagerRegistry;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use LaravelDoctrine\ORM\BootChain;
|
||||
use LaravelDoctrine\ORM\DoctrineServiceProvider;
|
||||
use LaravelDoctrine\ORM\IlluminateRegistry;
|
||||
|
||||
/**
|
||||
* Class CustomDoctrineServiceProvider
|
||||
* @package libs\utils
|
||||
*/
|
||||
final class CustomDoctrineServiceProvider extends DoctrineServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register the manager registry
|
||||
*/
|
||||
protected function registerManagerRegistry()
|
||||
{
|
||||
$this->app->singleton('registry', function ($app) {
|
||||
$registry = new IlluminateRegistry($app, $app->make(CustomEntityManagerFactory::class));
|
||||
|
||||
// Add all managers into the registry
|
||||
foreach ($app->make('config')->get('doctrine.managers', []) as $manager => $settings) {
|
||||
$registry->addManager($manager, $settings);
|
||||
}
|
||||
|
||||
return $registry;
|
||||
});
|
||||
|
||||
// Once the registry get's resolved, we will call the resolve callbacks which were waiting for the registry
|
||||
$this->app->afterResolving('registry', function (ManagerRegistry $registry, Container $container) {
|
||||
$this->bootExtensionManager();
|
||||
|
||||
BootChain::boot($registry);
|
||||
});
|
||||
|
||||
$this->app->alias('registry', ManagerRegistry::class);
|
||||
$this->app->alias('registry', IlluminateRegistry::class);
|
||||
}
|
||||
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
<?php namespace libs\utils;
|
||||
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use Doctrine\ORM\Cache\DefaultCacheFactory;
|
||||
use Doctrine\ORM\Cache\Logging\StatisticsCacheLogger;
|
||||
use Doctrine\ORM\Cache\RegionsConfiguration;
|
||||
use Doctrine\ORM\Configuration;
|
||||
use LaravelDoctrine\ORM\EntityManagerFactory;
|
||||
|
||||
/**
|
||||
* Class CustomEntityManagerFactory
|
||||
* @package libs\utils
|
||||
*/
|
||||
final class CustomEntityManagerFactory extends EntityManagerFactory
|
||||
{
|
||||
/**
|
||||
* @param Configuration $configuration
|
||||
*/
|
||||
protected function setSecondLevelCaching(Configuration $configuration)
|
||||
{
|
||||
$second_level_cache_config = $this->config->get('doctrine.cache.second_level', []);
|
||||
|
||||
if (!is_array($second_level_cache_config)) return;
|
||||
if (!isset($second_level_cache_config['enabled'])) return;
|
||||
if (!$second_level_cache_config['enabled']) return;
|
||||
|
||||
$configuration->setSecondLevelCacheEnabled(true);
|
||||
|
||||
$cacheConfig = $configuration->getSecondLevelCacheConfiguration();
|
||||
$regions_config = isset($second_level_cache_config['regions']) ? $second_level_cache_config['regions'] : [];
|
||||
|
||||
if (is_array($regions_config) && count($regions_config) > 0) {
|
||||
|
||||
$regions_configuration = new RegionsConfiguration
|
||||
(
|
||||
isset($second_level_cache_config['region_lifetime']) ? $second_level_cache_config['region_lifetime'] : 3600,
|
||||
isset($second_level_cache_config['region_lock_lifetime']) ? $second_level_cache_config['region_lock_lifetime'] : 60
|
||||
);
|
||||
|
||||
foreach ($regions_config as $region_name => $region_config) {
|
||||
if (isset($region_config['lifetime']))
|
||||
$regions_configuration->setLifetime($region_name, $region_config['lifetime']);
|
||||
|
||||
if (isset($region_config['lock_lifetime']))
|
||||
$regions_configuration->setLockLifetime($region_name, $region_config['lock_lifetime']);
|
||||
|
||||
}
|
||||
|
||||
$cacheConfig->setRegionsConfiguration($regions_configuration);
|
||||
}
|
||||
|
||||
// Cache logger
|
||||
if (isset($second_level_cache_config['log_enabled']) && $second_level_cache_config['log_enabled']){
|
||||
$logger = new StatisticsCacheLogger();
|
||||
$cacheConfig->setCacheLogger($logger);
|
||||
}
|
||||
|
||||
$factory = new DefaultCacheFactory
|
||||
(
|
||||
$cacheConfig->getRegionsConfiguration(),
|
||||
$this->cache->driver()
|
||||
);
|
||||
|
||||
$file_lock_region_directory = isset($second_level_cache_config['file_lock_region_directory']) ?
|
||||
$second_level_cache_config['file_lock_region_directory'] :
|
||||
'/tmp';
|
||||
|
||||
$factory->setFileLockRegionDirectory($file_lock_region_directory);
|
||||
|
||||
$cacheConfig->setCacheFactory
|
||||
(
|
||||
$factory
|
||||
);
|
||||
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
namespace libs\utils;
|
||||
|
||||
/**
|
||||
* Class DateTimeUtils
|
||||
* @package libs\utils
|
||||
*/
|
||||
abstract class DateTimeUtils
|
||||
{
|
||||
const MicrosecondsPrecision = 6;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function nowRfc2822(){
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
$usec = substr($usec, 2, self::MicrosecondsPrecision);
|
||||
return gmdate('Y-m-d H:i:s', $sec).'.'.$usec;
|
||||
}
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
namespace libs\utils;
|
||||
|
||||
/**
|
||||
* Class HTMLCleaner
|
||||
* @package libs\utils
|
||||
*/
|
||||
final class HTMLCleaner
|
||||
{
|
||||
/**
|
||||
* @param array $data
|
||||
* @param array $fields
|
||||
* @return array
|
||||
*/
|
||||
public static function cleanData(array $data, array $fields)
|
||||
{
|
||||
$config = \HTMLPurifier_Config::createDefault();
|
||||
// Remove any CSS or inline styles
|
||||
$config->set('CSS.AllowedProperties', []);
|
||||
$purifier = new \HTMLPurifier($config);
|
||||
foreach($fields as $field){
|
||||
if(!isset($data[$field])) continue;
|
||||
$data[$field] = $purifier->purify($data[$field]);
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
}
|
@ -1,114 +0,0 @@
|
||||
<?php namespace libs\utils;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Interface ICacheService
|
||||
* @package utils\services
|
||||
*/
|
||||
interface ICacheService
|
||||
{
|
||||
|
||||
/**
|
||||
* Determine if a key exists
|
||||
* @param $key
|
||||
* @return bool
|
||||
*/
|
||||
public function exists($key);
|
||||
|
||||
/**
|
||||
* Delete a key
|
||||
* @param $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function delete($key);
|
||||
|
||||
/**
|
||||
* Delete a key
|
||||
* @param array $keys
|
||||
* @return mixed
|
||||
*/
|
||||
public function deleteArray(array $keys);
|
||||
|
||||
/**
|
||||
* retrieves a hash
|
||||
* @param $name
|
||||
* @param array $values
|
||||
* @return array
|
||||
*/
|
||||
public function getHash($name, array $values);
|
||||
|
||||
/**
|
||||
* save a hash, with an optional time to live
|
||||
* @param $name
|
||||
* @param array $values
|
||||
* @param int $ttl
|
||||
* @return mixed
|
||||
*/
|
||||
public function storeHash($name, array $values, $ttl = 0);
|
||||
|
||||
/**
|
||||
* @param $counter_name
|
||||
* @param int $ttl
|
||||
* @return mixed
|
||||
*/
|
||||
public function incCounter($counter_name, $ttl = 0);
|
||||
|
||||
/**
|
||||
* @param $counter_name
|
||||
* @return mixed
|
||||
*/
|
||||
public function incCounterIfExists($counter_name);
|
||||
|
||||
public function addMemberSet($set_name, $member);
|
||||
|
||||
public function deleteMemberSet($set_name, $member);
|
||||
|
||||
public function getSet($set_name);
|
||||
|
||||
public function getSingleValue($key);
|
||||
|
||||
/**
|
||||
* @param $key
|
||||
* @param $value
|
||||
* @param int $ttl
|
||||
* @return mixed
|
||||
*/
|
||||
public function setSingleValue($key, $value, $ttl = 0);
|
||||
|
||||
/**
|
||||
* adds a single value if given keys does not exists, with an optional
|
||||
* time to live
|
||||
* @param $key
|
||||
* @param $value
|
||||
* @param int $ttl
|
||||
* @return mixed
|
||||
*/
|
||||
public function addSingleValue($key, $value, $ttl = 0);
|
||||
|
||||
/**
|
||||
* Set time to live to a given key
|
||||
* @param $key
|
||||
* @param $ttl
|
||||
* @return mixed
|
||||
*/
|
||||
public function setKeyExpiration($key, $ttl);
|
||||
|
||||
public function boot();
|
||||
|
||||
/**Returns the remaining time to live of a key that has a timeout.
|
||||
* @param string $key
|
||||
* @return int
|
||||
*/
|
||||
public function ttl($key);
|
||||
}
|
@ -1,184 +0,0 @@
|
||||
<?php namespace libs\utils;
|
||||
/**
|
||||
* Copyright 2021 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use DateTimeZone;
|
||||
use DateTime;
|
||||
use DateInterval;
|
||||
use Eluceo\iCal\Component\Timezone;
|
||||
use Eluceo\iCal\Component\Calendar;
|
||||
use Eluceo\iCal\Component\TimezoneRule;
|
||||
use Eluceo\iCal\Property\Event\RecurrenceRule;
|
||||
/**
|
||||
* Class ICalTimeZoneBuilder
|
||||
* @package CalDAVClient\Facade\Utils
|
||||
*/
|
||||
final class ICalTimeZoneBuilder
|
||||
{
|
||||
/**
|
||||
* @param DateTimeZone $time_zone
|
||||
* @return array
|
||||
*/
|
||||
private static function calculateTimeRangeForTransitions(DateTimeZone $time_zone){
|
||||
$now = new DateTime('now', $time_zone);
|
||||
$year = $now->format('Y');
|
||||
return [new DateTime('1/1/'.$year, $time_zone), new DateTime('1/1/'.($year + 1), $time_zone)];
|
||||
}
|
||||
/**
|
||||
* @param array $trans
|
||||
* @param int $former_offset
|
||||
* @return DateTime
|
||||
*/
|
||||
private static function convertStartDateFromUTC2Local(array $trans, $former_offset){
|
||||
$dt = new DateTime($trans['time'], new DateTimeZone('UTC'));
|
||||
$hours = abs($former_offset);
|
||||
// START TIME IS ON UTC and should be converted to local using former offset
|
||||
if($former_offset >= 0 )
|
||||
$dt->add(new DateInterval("PT{$hours}H"));
|
||||
else
|
||||
$dt->sub(new DateInterval("PT{$hours}H"));
|
||||
return $dt;
|
||||
}
|
||||
/**
|
||||
* @param DateTime $dt
|
||||
* @return RecurrenceRule
|
||||
*/
|
||||
private static function calculateRecurrenceRule(DateTime $dt){
|
||||
$r_rule = new RecurrenceRule();
|
||||
$r_rule->setFreq(RecurrenceRule::FREQ_YEARLY);
|
||||
$r_rule->setByMonth(intval($dt->format('m')));
|
||||
$r_rule->setByDay
|
||||
(
|
||||
self::translate2ByDay($dt)
|
||||
);
|
||||
return $r_rule;
|
||||
}
|
||||
/**
|
||||
* @param $offset
|
||||
* @return string
|
||||
*/
|
||||
private static function calculateOffsetFrom($offset){
|
||||
return sprintf('%s%02d%02d', $offset >= 0 ? '+' : '-', abs($offset), abs(($offset - floor($offset)) * 60));
|
||||
}
|
||||
/**
|
||||
* @param $offset
|
||||
* @return string
|
||||
*/
|
||||
private static function calculateOffsetTo($offset){
|
||||
return sprintf('%s%02d%02d', $offset >= 0 ? '+' : '-', abs($offset), abs(($offset - floor($offset)) * 60));
|
||||
}
|
||||
/**
|
||||
* @param DateTimeZone $time_zone
|
||||
* @param string $calendar_prod_id
|
||||
* @param bool $with_calendar_envelope
|
||||
* @return Calendar|Timezone
|
||||
*/
|
||||
public static function build(DateTimeZone $time_zone, $calendar_prod_id, $with_calendar_envelope = true){
|
||||
// get all transitions for one current year and next
|
||||
list($start_range, $end_range) = self::calculateTimeRangeForTransitions($time_zone);
|
||||
$transitions = $time_zone->getTransitions($start_range->getTimestamp(), $end_range->getTimestamp());
|
||||
$vTimezone = new Timezone($time_zone->getName());
|
||||
$former_offset = null;
|
||||
foreach ($transitions as $i => $trans) {
|
||||
$current_time_zone_rule = null;
|
||||
// skip the first entry...
|
||||
if ($i == 0) {
|
||||
// ... but remember the offset for the next TZOFFSETFROM value
|
||||
$former_offset = $trans['offset'] / 3600;
|
||||
continue;
|
||||
}
|
||||
// daylight saving time definition
|
||||
if ($trans['isdst']) {
|
||||
$current_time_zone_rule = new TimezoneRule(TimezoneRule::TYPE_DAYLIGHT);;
|
||||
}
|
||||
// standard time definition
|
||||
else {
|
||||
$current_time_zone_rule = new TimezoneRule(TimezoneRule::TYPE_STANDARD);;
|
||||
}
|
||||
if ($current_time_zone_rule) {
|
||||
$offset = $trans['offset'] / 3600;
|
||||
$dt = self::convertStartDateFromUTC2Local($trans, $former_offset);
|
||||
$current_time_zone_rule->setDtStart($dt);
|
||||
$current_time_zone_rule->setTzOffsetFrom(self::calculateOffsetFrom($former_offset));
|
||||
$current_time_zone_rule->setTzOffsetTo(self::calculateOffsetTo($offset));
|
||||
// add abbreviated timezone name if available
|
||||
if (!empty($trans['abbr'])) {
|
||||
$current_time_zone_rule->setTzName($trans['abbr']);
|
||||
}
|
||||
$former_offset = $offset;
|
||||
$current_time_zone_rule->setRecurrenceRule(self::calculateRecurrenceRule($dt));
|
||||
$vTimezone->addComponent($current_time_zone_rule);
|
||||
}
|
||||
}
|
||||
if($with_calendar_envelope) {
|
||||
$vCalendar = new Calendar(sprintf("'-//%s//EN'", $calendar_prod_id));
|
||||
$vCalendar->setTimezone($vTimezone);
|
||||
return $vCalendar;
|
||||
};
|
||||
return $vTimezone;
|
||||
}
|
||||
/**
|
||||
* The BYDAY rule part specifies a COMMA-separated list of days of
|
||||
* the week; SU indicates Sunday; MO indicates Monday; TU indicates
|
||||
* Tuesday; WE indicates Wednesday; TH indicates Thursday; FR
|
||||
* indicates Friday; and SA indicates Saturday.
|
||||
* Each BYDAY value can also be preceded by a positive (+n) or
|
||||
* negative (-n) integer.
|
||||
* @see https://tools.ietf.org/html/rfc5545#section-3.3.10 (BYDAY)
|
||||
* @see http://php.net/manual/en/datetime.formats.relative.php
|
||||
* @param DateTime $dt)
|
||||
* @return string
|
||||
*/
|
||||
private static function translate2ByDay(DateTime $dt){
|
||||
$day_name = substr(strtoupper($dt->format('D')), 0,2);
|
||||
$ordinals = ['first', 'second', 'third', 'fourth', 'last'];
|
||||
$day_nbr = 0;
|
||||
$is_last = false;
|
||||
foreach($ordinals as $idx => $ord){
|
||||
$dt_n = self::buildOrdinalDateTime($ord, $dt);
|
||||
if($dt_n->format('Y-m-d') == $dt->format('Y-m-d')){
|
||||
$day_nbr = $idx + 1;
|
||||
if($ord == 'last'){
|
||||
$is_last = true;
|
||||
$day_nbr = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return sprintf('%s%s%s', $is_last? '-':'', $day_nbr, $day_name);
|
||||
}
|
||||
/**
|
||||
* @param string $ord
|
||||
* @param DateTime $dt
|
||||
* @return DateTime
|
||||
*/
|
||||
private static function buildOrdinalDateTime($ord, DateTime $dt){
|
||||
return new DateTime
|
||||
(
|
||||
date
|
||||
("Y-m-d",
|
||||
strtotime
|
||||
(
|
||||
sprintf
|
||||
(
|
||||
self::GetOrdinalDayQuery,
|
||||
$ord,
|
||||
$dt->format('l'),
|
||||
$dt->format('F'),
|
||||
$dt->format('Y')
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
const GetOrdinalDayQuery = '%s %s of %s %s';
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php namespace libs\utils;
|
||||
|
||||
/**
|
||||
* Copyright 2017 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
interface IEncryptionService
|
||||
{
|
||||
public function encrypt($value);
|
||||
|
||||
public function decrypt($payload);
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
<?php namespace libs\utils;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Closure;
|
||||
/**
|
||||
* Interface ITransactionService
|
||||
* @package libs\utils
|
||||
*/
|
||||
interface ITransactionService
|
||||
{
|
||||
/**
|
||||
* Execute a Closure within a transaction.
|
||||
*
|
||||
* @param Closure $callback
|
||||
* @param int $isolationLevel
|
||||
* @return mixed
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function transaction(Closure $callback, int $isolationLevel = 2);
|
||||
}
|
@ -1,116 +0,0 @@
|
||||
<?php namespace libs\utils;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Class JsonUtils
|
||||
* http://json.org/
|
||||
* @package libs\utils
|
||||
*/
|
||||
abstract class JsonUtils
|
||||
{
|
||||
/**
|
||||
* A string is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes.
|
||||
* A character is represented as a single character string. A string is very much like a C or Java string.
|
||||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
public static function toJsonString($value)
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @return string
|
||||
*/
|
||||
public static function toObfuscatedEmail($value){
|
||||
$em = explode("@", $value);
|
||||
$name = implode(array_slice($em, 0, count($em) - 1), '@');
|
||||
$len = floor(mb_strlen($name) / 2);
|
||||
$obfuscated_email = mb_substr($name, 0, $len) . str_repeat('*', $len) . "@" . end($em);
|
||||
return $obfuscated_email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @return string
|
||||
*/
|
||||
public static function encodeUrl(?string $url):?string{
|
||||
if(empty($url)) return null;
|
||||
$url= rawurlencode($url);
|
||||
$url = str_replace("%3A",":", $url);
|
||||
$url = str_replace("%2F","/", $url);
|
||||
$url = str_replace("%3D","=", $url);
|
||||
$url = str_replace("%3F","?", $url);
|
||||
$url = str_replace("%26","&", $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return bool
|
||||
*/
|
||||
public static function toJsonBoolean($value)
|
||||
{
|
||||
if(empty($value)) return false;
|
||||
return boolval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return bool
|
||||
*/
|
||||
public static function toJsonColor($value)
|
||||
{
|
||||
if(empty($value))
|
||||
$value = 'f0f0ee';
|
||||
if (strpos($value,'#') === false) {
|
||||
$value = '#'.$value;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return int|null
|
||||
*/
|
||||
public static function toJsonInt($value)
|
||||
{
|
||||
if(empty($value)) return 0;
|
||||
return intval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return float|null
|
||||
*/
|
||||
public static function toJsonFloat($value)
|
||||
{
|
||||
if(empty($value)) return 0.00;
|
||||
return floatval($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return int
|
||||
*/
|
||||
public static function toEpoch($value)
|
||||
{
|
||||
if(empty($value)) return 0;
|
||||
$datetime = new \DateTime($value);
|
||||
return $datetime->getTimestamp();
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?php namespace libs\utils;
|
||||
/**
|
||||
* Copyright 2015 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class RequestUtils
|
||||
* @package libs\utils
|
||||
*/
|
||||
final class RequestUtils {
|
||||
|
||||
/**
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return bool|string
|
||||
*/
|
||||
public static function getCurrentRoutePath($request)
|
||||
{
|
||||
try
|
||||
{
|
||||
$route = Route::getRoutes()->match($request);
|
||||
if(is_null($route)) return false;
|
||||
$route_path = $route->uri();
|
||||
if (strpos($route_path, '/') != 0)
|
||||
$route_path = '/' . $route_path;
|
||||
|
||||
return $route_path;
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
Log::error($ex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2017 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Console\Command;
|
||||
use App\Services\Model\IAdminActionsCalendarSyncProcessingService;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
/**
|
||||
* Class AdminActionsCalendarSyncProcessingCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
final class AdminActionsCalendarSyncProcessingCommand extends Command
|
||||
{
|
||||
/**
|
||||
* @var IAdminActionsCalendarSyncProcessingService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
/**
|
||||
* MemberActionsCalendarSyncProcessingCommand constructor.
|
||||
* @param IAdminActionsCalendarSyncProcessingService $service
|
||||
*/
|
||||
public function __construct(IAdminActionsCalendarSyncProcessingService $service)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:admin-schedule-action-process';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Process Admin External Schedule Sync Actions';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:admin-schedule-action-process {batch_size?}';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$enabled = boolval(Config::get("cal_sync.enable_cal_sync", true));
|
||||
if(!$enabled){
|
||||
$this->info("task is not enabled!");
|
||||
return false;
|
||||
}
|
||||
|
||||
$batch_size = $this->argument('batch_size');
|
||||
if(empty($batch_size))
|
||||
$batch_size = PHP_INT_MAX;
|
||||
|
||||
$start = time();
|
||||
|
||||
$this->info(sprintf("processing batch size of %s", $batch_size));
|
||||
|
||||
|
||||
$res = $this->service->processActions($batch_size);
|
||||
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds - processed entries %s", $delta, $res));
|
||||
|
||||
}
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Console\Command;
|
||||
use services\model\IChatTeamService;
|
||||
/**
|
||||
* Class ChatTeamMessagesSender
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
final class ChatTeamMessagesSender extends Command {
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'teams:message-sender';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'teams:message-sender {bach_size?}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Send out Teams Chat Messages';
|
||||
|
||||
/**
|
||||
* @var IChatTeamService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
/**
|
||||
* ChatTeamMessagesSender constructor.
|
||||
* @param IChatTeamService $service
|
||||
*/
|
||||
public function __construct(IChatTeamService $service)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$bach_size = $this->argument('bach_size');
|
||||
if(is_null($bach_size)) $bach_size = 100;
|
||||
$res = $this->service->sendMessages($bach_size);
|
||||
$this->info(sprintf("total messages sent %s", $res));
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use App\Services\Model\IPresentationVideoMediaUploadProcessor;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class EnableMP4SupportAtMUXCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class EnableMP4SupportAtMUXCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:enable-mp4-support-mux';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:enable-mp4-support-mux {event_id}';
|
||||
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Enable MP4 Support at Mux';
|
||||
|
||||
/**
|
||||
* @param IPresentationVideoMediaUploadProcessor $service
|
||||
*/
|
||||
public function handle(IPresentationVideoMediaUploadProcessor $service)
|
||||
{
|
||||
$event_id = $this->argument('event_id');
|
||||
|
||||
if(empty($event_id))
|
||||
throw new \InvalidArgumentException("event_id is required");
|
||||
|
||||
$service->enableMP4Support(intval($event_id));
|
||||
}
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use App\Services\Model\IScheduleIngestionService;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class ExternalScheduleFeedIngestionCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
final class ExternalScheduleFeedIngestionCommand extends Command {
|
||||
|
||||
/**
|
||||
* @var IScheduleIngestionService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
/**
|
||||
* ExternalScheduleFeedIngestionCommand constructor.
|
||||
* @param IScheduleIngestionService $service
|
||||
*/
|
||||
public function __construct(IScheduleIngestionService $service)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:external-schedule-feed-ingestion-process';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Process External Schedule Feed for summits';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:external-schedule-feed-ingestion-process';
|
||||
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$this->info("starting summits external ingestion");
|
||||
$start = time();
|
||||
$this->service->ingestAllSummits();
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
log::info(sprintf("execution call %s seconds", $delta));
|
||||
}
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2017 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Console\Command;
|
||||
use App\Services\Model\IMemberActionsCalendarSyncProcessingService;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use models\summit\CalendarSync\CalendarSyncInfo;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class MemberActionsCalendarSyncProcessingCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
final class MemberActionsCalendarSyncProcessingCommand extends Command
|
||||
{
|
||||
/**
|
||||
* @var IMemberActionsCalendarSyncProcessingService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
/**
|
||||
* MemberActionsCalendarSyncProcessingCommand constructor.
|
||||
* @param IMemberActionsCalendarSyncProcessingService $service
|
||||
*/
|
||||
public function __construct(IMemberActionsCalendarSyncProcessingService $service)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:member-schedule-action-process';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Process Member External Schedule Sync Actions';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:member-schedule-action-process {provider} {batch_size?}';
|
||||
|
||||
public function handle()
|
||||
{
|
||||
$enabled = boolval(Config::get("cal_sync.enable_cal_sync", true));
|
||||
if(!$enabled){
|
||||
$this->info("task is not enabled!");
|
||||
return false;
|
||||
}
|
||||
|
||||
$batch_size = $this->argument('batch_size');
|
||||
$provider = $this->argument('provider');
|
||||
if(!CalendarSyncInfo::isValidProvider($provider)){
|
||||
$this->error("provider param is not valid , valid values are [Google, Outlook, iCloud]");
|
||||
log::error("provider param is not valid , valid values are [Google, Outlook, iCloud]");
|
||||
return false;
|
||||
}
|
||||
if(empty($batch_size))
|
||||
$batch_size = 1000;
|
||||
|
||||
$start = time();
|
||||
|
||||
$this->info(sprintf("processing provider %s - batch size of %s", $provider, $batch_size));
|
||||
log::info(sprintf("processing provider %s - batch size of %s", $provider, $batch_size));
|
||||
|
||||
$res = $this->service->processActions($provider, $batch_size);
|
||||
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds - processed entries %s", $delta, $res));
|
||||
log::info(sprintf("execution call %s seconds - processed entries %s", $delta, $res));
|
||||
}
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use App\Services\Model\IPresentationVideoMediaUploadProcessor;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class PresentationMaterialsCreateMUXAssetsCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
final class PresentationMaterialsCreateMUXAssetsCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:presentation-materials-mux-assets';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:presentation-materials-mux-assets {summit_id} {mounting_folder?} {event_id?}';
|
||||
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Process Presentation Videos and ingest on MUX';
|
||||
|
||||
/**
|
||||
* @param IPresentationVideoMediaUploadProcessor $service
|
||||
*/
|
||||
public function handle(IPresentationVideoMediaUploadProcessor $service)
|
||||
{
|
||||
$summit_id = $this->argument('summit_id');
|
||||
|
||||
$event_id = $this->argument('event_id');
|
||||
|
||||
if(empty($summit_id))
|
||||
throw new \InvalidArgumentException("summit_id is required");
|
||||
|
||||
$mountingFolder = $this->argument('mounting_folder');
|
||||
if(empty($mountingFolder))
|
||||
$mountingFolder = Config::get('mediaupload.mounting_folder');
|
||||
|
||||
Log::debug(sprintf("starting to process published presentations for summit id %s mountingFolder %s event id %s", $summit_id, $mountingFolder, $event_id));
|
||||
$this->info(sprintf("starting to process published presentations for summit id %s mountingFolder %s event id %s", $summit_id, $mountingFolder, $event_id));
|
||||
|
||||
if(empty($event_id)) {
|
||||
$service->processPublishedPresentationFor(intval($summit_id), $mountingFolder);
|
||||
return;
|
||||
}
|
||||
|
||||
$service->processEvent(intval($event_id), $mountingFolder);
|
||||
}
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use App\Services\Model\IAttendeeService;
|
||||
use Illuminate\Console\Command;
|
||||
use models\summit\ISummitRepository;
|
||||
/**
|
||||
* Class PromoCodesRedeemProcessor
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
final class PromoCodesRedeemProcessor extends Command
|
||||
{
|
||||
/**
|
||||
* @var IAttendeeService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
/**
|
||||
* @var ISummitRepository
|
||||
*/
|
||||
private $repository;
|
||||
|
||||
|
||||
/**
|
||||
* PromoCodesRedeemProcessor constructor.
|
||||
* @param IAttendeeService $service
|
||||
* @param ISummitRepository $repository
|
||||
*/
|
||||
public function __construct
|
||||
(
|
||||
IAttendeeService $service,
|
||||
ISummitRepository $repository
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->repository = $repository;
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:promo-codes-redeem-processor';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:promo-codes-redeem-processor {summit_id?}';
|
||||
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Redeems promo codes per summit';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$summit_id = $this->argument('summit_id');
|
||||
|
||||
if(is_null($summit_id))// if we dont provide a summit id, then get current
|
||||
$summit = $this->repository->getCurrentAndAvailable();
|
||||
else
|
||||
$summit = $this->repository->getById(intval($summit_id));
|
||||
$this->info(sprintf("starting to process promo codes for summit id %s", $summit->getIdentifier()));
|
||||
$has_more_items = false;
|
||||
$page = 1;
|
||||
|
||||
do{
|
||||
$this->info(sprintf("processing page %s for summit id %s", $page, $summit->getIdentifier()));
|
||||
$has_more_items = $this->service->updateRedeemedPromoCodes($summit, $page);
|
||||
++$page;
|
||||
} while($has_more_items);
|
||||
|
||||
$this->info(sprintf("finished to process promo codes for summit id %s", $summit->getIdentifier()));
|
||||
}
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use App\Services\Model\IAttendeeService;
|
||||
use Illuminate\Console\Command;
|
||||
use models\summit\ISummitRepository;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class RecalculateAttendeesStatusCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class RecalculateAttendeesStatusCommand extends Command {
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:recalculate-attendees-status';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:recalculate-attendees-status {summit_id}';
|
||||
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Recalculate Attendees Status';
|
||||
|
||||
/**
|
||||
* @var ISummitRepository
|
||||
*/
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* @var IAttendeeService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
public function __construct(
|
||||
ISummitRepository $repository,
|
||||
IAttendeeService $service
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->repository = $repository;
|
||||
$this->service = $service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
try {
|
||||
|
||||
$start = time();
|
||||
$summit_id = $this->argument('summit_id');
|
||||
if(empty($summit_id))
|
||||
throw new \InvalidArgumentException("summit_id is required");
|
||||
$this->service->recalculateAttendeeStatus(intval($summit_id));
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
Log::error($ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use App\Services\Model\ISummitOrderService;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Exception;
|
||||
/**
|
||||
* Class RegistrationSummitOrderReminderEmailCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class RegistrationSummitOrderReminderEmailCommand extends Command
|
||||
{
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:registration-order-reminder-action-email';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:registration-order-reminder-action-email';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Process all Order without Action';
|
||||
|
||||
/**
|
||||
* @var ISummitOrderService
|
||||
*/
|
||||
private $order_service;
|
||||
|
||||
/**
|
||||
* RegistrationSummitOrderRevocationCommand constructor.
|
||||
* @param ISummitOrderService $order_service
|
||||
*/
|
||||
public function __construct(ISummitOrderService $order_service)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->order_service = $order_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
try {
|
||||
$this->info("processing summit orders without action");
|
||||
$start = time();
|
||||
Log::debug("RegistrationSummitOrderReminderEmailCommand::handle");
|
||||
$this->order_service->processAllOrderReminder();
|
||||
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
Log::error($ex);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use App\Services\Model\ISummitOrderService;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* Class RegistrationSummitOrderRevocationCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class RegistrationSummitOrderRevocationCommand extends Command
|
||||
{
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:order-reservation-revocation';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:order-reservation-revocation';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Revokes all reserved orders after N minutes without action';
|
||||
|
||||
/**
|
||||
* @var ISummitOrderService
|
||||
*/
|
||||
private $order_service;
|
||||
|
||||
/**
|
||||
* RegistrationSummitOrderRevocationCommand constructor.
|
||||
* @param ISummitOrderService $order_service
|
||||
*/
|
||||
public function __construct(ISummitOrderService $order_service)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->order_service = $order_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
$enabled = Config::get("registration.enable_orders_reservation_revocation", true);
|
||||
if (!$enabled) {
|
||||
$this->info("task is not enabled!");
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
$this->info("processing summit orders reservations");
|
||||
$start = time();
|
||||
$lifetime = intval(Config::get("registration.reservation_lifetime", 30));
|
||||
Log::info(sprintf("RegistrationSummitOrderRevocationCommand: using lifetime of %s ", $lifetime));
|
||||
|
||||
Log::info("RegistrationSummitOrderRevocationCommand: invoking revokeReservedOrdersOlderThanNMinutes");
|
||||
$this->order_service->revokeReservedOrdersOlderThanNMinutes($lifetime);
|
||||
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
|
||||
$start = time();
|
||||
Log::info("RegistrationSummitOrderRevocationCommand: invoking confirmOrdersOlderThanNMinutes");
|
||||
$this->order_service->confirmOrdersOlderThanNMinutes($lifetime);
|
||||
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
} catch (Exception $ex) {
|
||||
Log::error($ex);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class SummitEmailFlowEventSeederCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class SummitEmailFlowEventSeederCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:seed-email-flow-events';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:seed-email-flow-events';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Seed Email Flow Event on Summits';
|
||||
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
|
||||
$start = time();
|
||||
\SummitEmailFlowEventSeeder::seed();
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
Log::error($ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Exception;
|
||||
/**
|
||||
* Class SummitEmailFlowTypeSeederCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class SummitEmailFlowTypeSeederCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:seed-email-flow-types';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:seed-email-flow-types';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Seed Email Flow Types';
|
||||
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
|
||||
$start = time();
|
||||
\SummitEmailFlowTypeSeeder::seed();
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
Log::error($ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Console\Command;
|
||||
use services\model\ISummitService;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
/**
|
||||
* Class SummitEventSetAvgRateProcessor
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class SummitEventSetAvgRateProcessor extends Command
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:feedback-avg-rate-processor';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:feedback-avg-rate-processor';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Calculate all AVG feedback rate for all schedule for all ongoing summits';
|
||||
|
||||
/**
|
||||
* @var ISummitService
|
||||
*/
|
||||
private $summit_service;
|
||||
|
||||
/**
|
||||
* SummitEventSetAvgRateProcessor constructor.
|
||||
* @param ISummitService $summit_service
|
||||
*/
|
||||
public function __construct(ISummitService $summit_service)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->summit_service = $summit_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
|
||||
$this->info("processing SummitEventSetAvgRateProcessor");
|
||||
$start = time();
|
||||
$this->summit_service->calculateFeedbackAverageForOngoingSummits();
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
Log::error($ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use services\model\ISummitService;
|
||||
use Exception;
|
||||
/**
|
||||
* Class SummitForwardXDays
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class SummitForwardXDays extends Command
|
||||
{
|
||||
/**
|
||||
* @var ISummitService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:forward-x-days';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:forward-x-days {tenant} {summit_id} {days} {--negative} {--check-ended}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Advance a summit forward by x days';
|
||||
|
||||
/**
|
||||
* @var ISummitService
|
||||
*/
|
||||
private $summit_service;
|
||||
|
||||
/**
|
||||
* SummitEventSetAvgRateProcessor constructor.
|
||||
* @param ISummitService $summit_service
|
||||
*/
|
||||
public function __construct(ISummitService $summit_service)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->summit_service = $summit_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
$tenant = $this->argument('tenant');
|
||||
if(empty($tenant))
|
||||
throw new \InvalidArgumentException("tenant is required");
|
||||
|
||||
$current_tenant = Config::get("app.tenant_name");
|
||||
|
||||
Log::debug(sprintf("SummitForwardXDays::handle tenant %s current_tenant %s", $tenant, $current_tenant));
|
||||
|
||||
if($tenant != $current_tenant){
|
||||
Log::warning(sprintf("SummitForwardXDays::handle exiting bc tenants are not the same"));
|
||||
return;
|
||||
}
|
||||
|
||||
$summit_id = $this->argument('summit_id');
|
||||
if(empty($summit_id))
|
||||
throw new \InvalidArgumentException("summit_id is required");
|
||||
|
||||
$days = $this->argument('days');
|
||||
if(empty($days))
|
||||
throw new \InvalidArgumentException("days is required");
|
||||
|
||||
$negative = $this->option('negative');
|
||||
$check_summit_ends = $this->option('check-ended');
|
||||
$this->info("processing SummitForwardXDays");
|
||||
$start = time();
|
||||
|
||||
$days = intval($days);
|
||||
|
||||
$this->summit_service->advanceSummit(intval($summit_id), $days, $negative, $check_summit_ends);
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
Log::warning($ex);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,120 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Console\Command;
|
||||
use libs\utils\ICacheService;
|
||||
use models\summit\ISummitRepository;
|
||||
use ModelSerializers\SerializerRegistry;
|
||||
use services\model\ISummitService;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
/**
|
||||
* Class SummitJsonGenerator
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
final class SummitJsonGenerator extends Command {
|
||||
|
||||
/**
|
||||
* @var ISummitService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
/**
|
||||
* @var ISummitRepository
|
||||
*/
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* @var ICacheService
|
||||
*/
|
||||
private $cache_service;
|
||||
|
||||
/**
|
||||
* SummitJsonGenerator constructor.
|
||||
* @param ISummitRepository $repository
|
||||
* @param ISummitService $service
|
||||
* @param ICacheService $cache_service
|
||||
*/
|
||||
public function __construct(
|
||||
ISummitRepository $repository,
|
||||
ISummitService $service,
|
||||
ICacheService $cache_service
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->repository = $repository;
|
||||
$this->service = $service;
|
||||
$this->cache_service = $cache_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:json-generator';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:json-generator';
|
||||
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Regenerates All Summits Initial Json';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
$summits = $this->repository->getAvailables();
|
||||
|
||||
foreach($summits as $summit) {
|
||||
|
||||
$this->info(sprintf("processing summit %s (%s)", $summit->getName(), $summit->getId()));
|
||||
$start = time();
|
||||
$expand = 'schedule';
|
||||
|
||||
$data = SerializerRegistry::getInstance()->getSerializer($summit)->serialize($expand);
|
||||
if (is_null($data)) return;
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
$current_time = time();
|
||||
$key_current = sprintf('/api/v1/summits/%s.expand=%s', 'current', urlencode($expand));
|
||||
$key_id = sprintf('/api/v1/summits/%s.expand=%s', $summit->getIdentifier(), urlencode($expand));
|
||||
|
||||
$cache_lifetime = intval(Config::get('cache_api_response.get_summit_response_lifetime', 600));
|
||||
|
||||
if ($summit->isActive()) {
|
||||
$this->cache_service->setSingleValue($key_current, gzdeflate(json_encode($data), 9), $cache_lifetime);
|
||||
$this->cache_service->setSingleValue($key_current . ".generated", $current_time, $cache_lifetime);
|
||||
}
|
||||
|
||||
$this->cache_service->setSingleValue($key_id, gzdeflate(json_encode($data), 9), $cache_lifetime);
|
||||
$this->cache_service->setSingleValue($key_id . ".generated", $current_time, $cache_lifetime);
|
||||
|
||||
$this->info(sprintf("regenerated cache for summit id %s", $summit->getIdentifier()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,129 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2017 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use libs\utils\ICacheService;
|
||||
use Exception;
|
||||
use models\summit\ISummitRepository;
|
||||
use services\model\ISummitService;
|
||||
use utils\PagingResponse;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
/**
|
||||
* Class SummitListJsonGenerator
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
final class SummitListJsonGenerator extends Command {
|
||||
|
||||
/**
|
||||
* @var ISummitService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
/**
|
||||
* @var ISummitRepository
|
||||
*/
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* @var ICacheService
|
||||
*/
|
||||
private $cache_service;
|
||||
|
||||
/**
|
||||
* SummitJsonGenerator constructor.
|
||||
* @param ISummitRepository $repository
|
||||
* @param ISummitService $service
|
||||
* @param ICacheService $cache_service
|
||||
*/
|
||||
public function __construct(
|
||||
ISummitRepository $repository,
|
||||
ISummitService $service,
|
||||
ICacheService $cache_service
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->repository = $repository;
|
||||
$this->service = $service;
|
||||
$this->cache_service = $cache_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit-list:json-generator';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit-list:json-generator';
|
||||
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Regenerates Summit List Json';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
try {
|
||||
|
||||
$this->info("processing summits");
|
||||
$start = time();
|
||||
$summits = $this->repository->getAvailables();
|
||||
|
||||
$response = new PagingResponse
|
||||
(
|
||||
count($summits),
|
||||
count($summits),
|
||||
1,
|
||||
1,
|
||||
$summits
|
||||
);
|
||||
|
||||
$data = $response->toArray();
|
||||
$key_id = "/api/v1/summits";
|
||||
$key_id_public = "/api/public/v1/summits";
|
||||
|
||||
$cache_lifetime = intval(Config::get('server.response_cache_lifetime', 300));
|
||||
$current_time = time();
|
||||
Log::info(sprintf("writing cached response for %s", $key_id));
|
||||
$this->info(sprintf("writing cached response for %s", $key_id));
|
||||
$this->cache_service->setSingleValue($key_id, gzdeflate(json_encode($data), 9), $cache_lifetime);
|
||||
$this->cache_service->setSingleValue($key_id.".generated", $current_time, $cache_lifetime);
|
||||
Log::info(sprintf("writing cached response for %s", $key_id_public));
|
||||
$this->info(sprintf("writing cached response for %s", $key_id_public));
|
||||
$this->cache_service->setSingleValue($key_id_public, gzdeflate(json_encode($data), 9), $cache_lifetime);
|
||||
$this->cache_service->setSingleValue($key_id_public.".generated", $current_time, $cache_lifetime);
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
Log::error($ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use App\Services\Model\ILocationService;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
use Exception;
|
||||
/**
|
||||
* Class SummitRoomReservationRevocationCommand
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
final class SummitRoomReservationRevocationCommand extends Command {
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:room-reservation-revocation';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:room-reservation-revocation';
|
||||
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Revokes all reserved bookable room reservations after N minutes';
|
||||
|
||||
|
||||
/**
|
||||
* @var ILocationService
|
||||
*/
|
||||
private $location_service;
|
||||
|
||||
|
||||
/**
|
||||
* SummitRoomReservationRevocationCommand constructor.
|
||||
* @param ILocationService $location_service
|
||||
*/
|
||||
public function __construct
|
||||
(
|
||||
ILocationService $location_service
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->location_service = $location_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$enabled = Config::get("bookable_rooms.enable_bookable_rooms_reservation_revocation", false);
|
||||
if(!$enabled){
|
||||
$this->info("task is not enabled!");
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
$this->info("processing summit room reservations");
|
||||
$start = time();
|
||||
$lifetime = intval(Config::get("bookable_rooms.reservation_lifetime", 30));
|
||||
Log::info(sprintf("SummitRoomReservationRevocationCommand: using lifetime of %s ", $lifetime));
|
||||
$this->location_service->revokeBookableRoomsReservedOlderThanNMinutes($lifetime);
|
||||
$end = time();
|
||||
$delta = $end - $start;
|
||||
$this->info(sprintf("execution call %s seconds", $delta));
|
||||
}
|
||||
catch (Exception $ex) {
|
||||
Log::error($ex);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
<?php namespace App\Console\Commands;
|
||||
/**
|
||||
* Copyright 2021 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use libs\utils\ICacheService;
|
||||
use models\summit\ISummitRepository;
|
||||
use services\model\ISummitService;
|
||||
/**
|
||||
* Class SummitSyncAllPresentationActions
|
||||
* @package App\Console\Commands
|
||||
*/
|
||||
class SummitSyncAllPresentationActions extends Command {
|
||||
/**
|
||||
* @var ISummitService
|
||||
*/
|
||||
private $service;
|
||||
|
||||
/**
|
||||
* @var ISummitRepository
|
||||
*/
|
||||
private $repository;
|
||||
|
||||
/**
|
||||
* @var ICacheService
|
||||
*/
|
||||
private $cache_service;
|
||||
|
||||
/**
|
||||
* SummitSyncAllPresentationActions constructor.
|
||||
* @param ISummitRepository $repository
|
||||
* @param ISummitService $service
|
||||
* @param ICacheService $cache_service
|
||||
*/
|
||||
public function __construct(
|
||||
ISummitRepository $repository,
|
||||
ISummitService $service,
|
||||
ICacheService $cache_service
|
||||
)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->repository = $repository;
|
||||
$this->service = $service;
|
||||
$this->cache_service = $cache_service;
|
||||
}
|
||||
|
||||
/**
|
||||
* The console command name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'summit:synch-presentation-actions';
|
||||
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'summit:synch-presentation-actions';
|
||||
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Synch All Summits Presention Actions';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$summits = $this->repository->getCurrentAndFutureSummits();
|
||||
foreach($summits as $summit) {
|
||||
Log::debug(sprintf("SummitSyncAllPresentationActions::handle processing summit %s (%s)", $summit->getName(), $summit->getId()));
|
||||
$this->info(sprintf("processing summit %s (%s)", $summit->getName(), $summit->getId()));
|
||||
$summit->synchAllPresentationActions();
|
||||
$this->info(sprintf("regenerated presentation actions for summit id %s", $summit->getIdentifier()));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,115 +0,0 @@
|
||||
<?php namespace App\Console;
|
||||
/**
|
||||
* Copyright 2017 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use App\Console\Commands\PresentationMaterialsCreateMUXAssetsCommand;
|
||||
use App\Console\Commands\SummitSyncAllPresentationActions;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use models\summit\CalendarSync\CalendarSyncInfo;
|
||||
/**
|
||||
* Class Kernel
|
||||
* @package App\Console
|
||||
*/
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
\App\Console\Commands\SummitJsonGenerator::class,
|
||||
\App\Console\Commands\MemberActionsCalendarSyncProcessingCommand::class,
|
||||
\App\Console\Commands\AdminActionsCalendarSyncProcessingCommand::class,
|
||||
\App\Console\Commands\ChatTeamMessagesSender::class,
|
||||
\App\Console\Commands\SummitListJsonGenerator::class,
|
||||
\App\Console\Commands\PromoCodesRedeemProcessor::class,
|
||||
\App\Console\Commands\SummitRoomReservationRevocationCommand::class,
|
||||
\App\Console\Commands\ExternalScheduleFeedIngestionCommand::class,
|
||||
\App\Console\Commands\SummitEventSetAvgRateProcessor::class,
|
||||
\App\Console\Commands\RegistrationSummitOrderRevocationCommand::class,
|
||||
\App\Console\Commands\RegistrationSummitOrderReminderEmailCommand::class,
|
||||
\App\Console\Commands\SummitForwardXDays::class,
|
||||
\App\Console\Commands\SummitEmailFlowEventSeederCommand::class,
|
||||
\App\Console\Commands\SummitEmailFlowTypeSeederCommand::class,
|
||||
\App\Console\Commands\PresentationMaterialsCreateMUXAssetsCommand::class,
|
||||
\App\Console\Commands\RecalculateAttendeesStatusCommand::class,
|
||||
\App\Console\Commands\EnableMP4SupportAtMUXCommand::class,
|
||||
\App\Console\Commands\SummitSyncAllPresentationActions::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// regenerate available summits cache
|
||||
|
||||
$env = App::environment();
|
||||
|
||||
// summit json cache
|
||||
$schedule->command('summit:json-generator')->everyFiveMinutes()->withoutOverlapping()->onOneServer();
|
||||
|
||||
// synch presentation actions
|
||||
$schedule->command('summit:synch-presentation-actions')->everyFiveMinutes()->withoutOverlapping()->onOneServer();
|
||||
|
||||
// list of available summits
|
||||
$schedule->command('summit-list:json-generator')->everyFiveMinutes()->withoutOverlapping()->onOneServer();
|
||||
|
||||
// Calendar Sync Jobs
|
||||
|
||||
// Admin Actions
|
||||
//$schedule->command('summit:admin-schedule-action-process')->withoutOverlapping();
|
||||
// Member Actions
|
||||
// Google Calendar
|
||||
//$schedule->command('summit:member-schedule-action-process', [CalendarSyncInfo::ProviderGoogle, 1000])->withoutOverlapping();
|
||||
// Outlook
|
||||
//$schedule->command('summit:member-schedule-action-process', [CalendarSyncInfo::ProviderOutlook, 1000])->withoutOverlapping();
|
||||
// iCloud
|
||||
//$schedule->command('summit:member-schedule-action-process', [CalendarSyncInfo::ProvideriCloud, 1000])->withoutOverlapping();
|
||||
|
||||
// redeem code processor
|
||||
|
||||
//$schedule->command('summit:promo-codes-redeem-processor', [end($summit_ids)])->daily()->withoutOverlapping();
|
||||
|
||||
// bookable rooms
|
||||
|
||||
$schedule->command('summit:room-reservation-revocation')->everyFiveMinutes()->withoutOverlapping()->onOneServer();
|
||||
// external schedule ingestion task
|
||||
|
||||
$schedule->command("summit:external-schedule-feed-ingestion-process")->everyFifteenMinutes()->withoutOverlapping()->onOneServer();
|
||||
|
||||
// AVG schedule feedback rate
|
||||
$schedule->command("summit:feedback-avg-rate-processor")->everyFifteenMinutes()->withoutOverlapping()->onOneServer();
|
||||
// registration orders
|
||||
|
||||
$schedule->command('summit:order-reservation-revocation')->everyFiveMinutes()->withoutOverlapping()->onOneServer();
|
||||
|
||||
// reminder emails
|
||||
|
||||
$schedule->command('summit:registration-order-reminder-action-email')->everyThirtyMinutes()->timezone(new \DateTimeZone('UTC'))->withoutOverlapping()->onOneServer();
|
||||
|
||||
if ($env == 'production') {
|
||||
// FNTECH production YOCO (13) advance AT 0700 AM ( 12:00 AM PST)
|
||||
$schedule->command("summit:forward-x-days", ["FNTECH", 13, 2, '--check-ended'])->dailyAt("07:00")->timezone('UTC')->withoutOverlapping()->onOneServer();
|
||||
// FNTECH production Hybrid Alive (30) advance AT 0700 AM ( 12:00 AM PST)
|
||||
$schedule->command("summit:forward-x-days", ["FNTECH", 30, 3, '--check-ended'])->dailyAt("07:00")->timezone('UTC')->withoutOverlapping()->onOneServer();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
<?php namespace App\EntityPersisters;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use models\summit\CalendarSync\WorkQueue\AdminSummitEventActionSyncWorkRequest;
|
||||
|
||||
/**
|
||||
* Class AdminSummitEventActionSyncWorkRequestPersister
|
||||
* @package App\EntityPersisters
|
||||
*/
|
||||
final class AdminSummitEventActionSyncWorkRequestPersister extends BasePersister
|
||||
{
|
||||
/**
|
||||
* @param AdminSummitEventActionSyncWorkRequest $request
|
||||
*/
|
||||
public static function persist(AdminSummitEventActionSyncWorkRequest $request){
|
||||
|
||||
$sql = <<<SQL
|
||||
INSERT INTO AbstractCalendarSyncWorkRequest
|
||||
(`Type`, IsProcessed, ProcessedDate, Created, LastEdited, ClassName)
|
||||
VALUES (:Type, 0, NULL, NOW(), NOW(), 'AdminSummitEventActionSyncWorkRequest');
|
||||
SQL;
|
||||
|
||||
$bindings = [
|
||||
'Type' => $request->getType(),
|
||||
'CreatedByID' => $request->getCreatedById(),
|
||||
'SummitEventID' => $request->getSummitEventId(),
|
||||
];
|
||||
|
||||
$types = [
|
||||
'Type' => 'string',
|
||||
'CreatedByID' => 'integer',
|
||||
'SummitEventID' => 'integer',
|
||||
];
|
||||
|
||||
self::insert($sql, $bindings, $types);
|
||||
|
||||
$sql = <<<SQL
|
||||
INSERT INTO AdminScheduleSummitActionSyncWorkRequest (ID, CreatedByID) VALUES (LAST_INSERT_ID(), :CreatedByID)
|
||||
SQL;
|
||||
self::insert($sql, $bindings, $types);
|
||||
|
||||
$sql = <<<SQL
|
||||
INSERT INTO AdminSummitEventActionSyncWorkRequest (ID, SummitEventID) VALUES (LAST_INSERT_ID(), :SummitEventID);
|
||||
SQL;
|
||||
self::insert($sql, $bindings, $types);
|
||||
|
||||
}
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
<?php namespace App\EntityPersisters;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use models\summit\CalendarSync\WorkQueue\AdminSummitLocationActionSyncWorkRequest;
|
||||
/**
|
||||
* Class AdminSummitLocationActionSyncWorkRequestPersister
|
||||
* @package App\EntityPersisters
|
||||
*/
|
||||
final class AdminSummitLocationActionSyncWorkRequestPersister extends BasePersister
|
||||
{
|
||||
/**
|
||||
* @param AdminSummitLocationActionSyncWorkRequest $request
|
||||
*/
|
||||
public static function persist(AdminSummitLocationActionSyncWorkRequest $request){
|
||||
|
||||
$sql = <<<SQL
|
||||
INSERT INTO AbstractCalendarSyncWorkRequest
|
||||
(`Type`, IsProcessed, ProcessedDate, Created, LastEdited, ClassName)
|
||||
VALUES (:Type, 0, NULL, NOW(), NOW(), 'AdminSummitLocationActionSyncWorkRequest');
|
||||
SQL;
|
||||
|
||||
$bindings = [
|
||||
'Type' => $request->getType(),
|
||||
'CreatedByID' => $request->getCreatedById(),
|
||||
'LocationID' => $request->getLocationId(),
|
||||
];
|
||||
|
||||
$types = [
|
||||
'Type' => 'string',
|
||||
'CreatedByID' => 'integer',
|
||||
'LocationID' => 'integer',
|
||||
];
|
||||
|
||||
self::insert($sql, $bindings, $types);
|
||||
|
||||
$sql = <<<SQL
|
||||
INSERT INTO AdminScheduleSummitActionSyncWorkRequest (ID, CreatedByID) VALUES (LAST_INSERT_ID(), :CreatedByID)
|
||||
SQL;
|
||||
self::insert($sql, $bindings, $types);
|
||||
|
||||
$sql = <<<SQL
|
||||
INSERT INTO AdminSummitLocationActionSyncWorkRequest (ID, LocationID) VALUES (LAST_INSERT_ID(), :LocationID);
|
||||
SQL;
|
||||
|
||||
self::insert($sql, $bindings, $types);
|
||||
|
||||
}
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
<?php namespace App\EntityPersisters;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use models\main\AssetsSyncRequest;
|
||||
/**
|
||||
* Class AssetSyncRequestPersister
|
||||
* @package App\EntityPersisters
|
||||
*/
|
||||
final class AssetSyncRequestPersister extends BasePersister
|
||||
{
|
||||
/**
|
||||
* @param AssetsSyncRequest $assets_sync_request
|
||||
*/
|
||||
public static function persist(AssetsSyncRequest $assets_sync_request){
|
||||
$sql = <<<SQL
|
||||
INSERT INTO AssetsSyncRequest
|
||||
(
|
||||
ClassName,
|
||||
Created,
|
||||
LastEdited,
|
||||
`Origin`,
|
||||
`Destination`,
|
||||
Processed,
|
||||
ProcessedDate
|
||||
)
|
||||
VALUES
|
||||
('AssetsSyncRequest', NOW(), NOW(), :FromFile, :ToFile, 0, NULL );
|
||||
|
||||
SQL;
|
||||
|
||||
$bindings = [
|
||||
'FromFile' => $assets_sync_request->getFrom(),
|
||||
'ToFile' => $assets_sync_request->getTo(),
|
||||
];
|
||||
|
||||
$types = [
|
||||
'FromFile' => 'string',
|
||||
'ToFile' => 'string',
|
||||
|
||||
];
|
||||
|
||||
self::insert($sql, $bindings, $types);
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
<?php namespace App\EntityPersisters;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use LaravelDoctrine\ORM\Facades\Registry;
|
||||
use models\utils\SilverstripeBaseModel;
|
||||
/**
|
||||
* Class BasePersister
|
||||
* @package App\EntityPersisters
|
||||
*/
|
||||
abstract class BasePersister
|
||||
{
|
||||
/**
|
||||
* @param string $sql
|
||||
* @param array $bindings
|
||||
*/
|
||||
protected static function insert($sql, array $bindings, array $types){
|
||||
$em = Registry::getManager(SilverstripeBaseModel::EntityManager);
|
||||
$em->getConnection()->executeUpdate($sql, $bindings, $types);
|
||||
}
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
<?php namespace App\EntityPersisters;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use models\summit\SummitEntityEvent;
|
||||
/**
|
||||
* Class EntityEventPersister
|
||||
* @package App\EntityPersisters
|
||||
*/
|
||||
final class EntityEventPersister extends BasePersister
|
||||
{
|
||||
/**
|
||||
* @param SummitEntityEvent $entity_event
|
||||
*/
|
||||
public static function persist(SummitEntityEvent $entity_event){
|
||||
$sql = <<<SQL
|
||||
INSERT INTO SummitEntityEvent
|
||||
(EntityID, EntityClassName, Type, Metadata, Created, LastEdited, OwnerID, SummitID)
|
||||
VALUES (:EntityID, :EntityClassName, :Type, :Metadata, :Created, :LastEdited, :OwnerID, :SummitID)
|
||||
SQL;
|
||||
|
||||
$bindings = [
|
||||
'EntityID' => $entity_event->getEntityId(),
|
||||
'EntityClassName' => $entity_event->getEntityClassName(),
|
||||
'Type' => $entity_event->getType(),
|
||||
'Metadata' => $entity_event->getRawMetadata(),
|
||||
'Created' => $entity_event->getCreated(),
|
||||
'LastEdited' => $entity_event->getLastEdited(),
|
||||
'OwnerID' => $entity_event->getOwnerId(),
|
||||
'SummitID' => $entity_event->getSummitId()
|
||||
];
|
||||
|
||||
$types = [
|
||||
'EntityID' => 'integer',
|
||||
'EntityClassName' => 'string',
|
||||
'Type' => 'string',
|
||||
'Metadata' => 'string',
|
||||
'Created' => 'datetime',
|
||||
'LastEdited' => 'datetime',
|
||||
'OwnerID' => 'integer',
|
||||
'SummitID' => 'integer',
|
||||
];
|
||||
|
||||
self::insert($sql, $bindings, $types);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param SummitEntityEvent[] $entity_events
|
||||
*/
|
||||
public static function persist_list(array $entity_events){
|
||||
foreach ($entity_events as $entity_event)
|
||||
self::persist($entity_event);
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
/**
|
||||
* Class BookableRoomReservationAction
|
||||
* @package App\Events
|
||||
*/
|
||||
abstract class BookableRoomReservationAction
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $reservation_id;
|
||||
|
||||
/**
|
||||
* BookableRoomReservationAction constructor.
|
||||
* @param int $reservation_id
|
||||
*/
|
||||
public function __construct(int $reservation_id)
|
||||
{
|
||||
$this->reservation_id = $reservation_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getReservationId(): int
|
||||
{
|
||||
return $this->reservation_id;
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class BookableRoomReservationCanceled
|
||||
* @package App\Events\BookableRooms
|
||||
*/
|
||||
final class BookableRoomReservationCanceled extends BookableRoomReservationAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class BookableRoomReservationRefundAccepted
|
||||
* @package App\Events
|
||||
*/
|
||||
final class BookableRoomReservationRefundAccepted extends BookableRoomReservationAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class CreatedBookableRoomReservation
|
||||
* @package App\Events
|
||||
*/
|
||||
final class CreatedBookableRoomReservation extends BookableRoomReservationAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class PaymentBookableRoomReservationConfirmed
|
||||
* @package App\Events
|
||||
*/
|
||||
final class PaymentBookableRoomReservationConfirmed extends BookableRoomReservationAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class RequestedBookableRoomReservationRefund
|
||||
* @package App\Events
|
||||
*/
|
||||
final class RequestedBookableRoomReservationRefund extends BookableRoomReservationAction
|
||||
{
|
||||
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
abstract class Event
|
||||
{
|
||||
//
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
/**
|
||||
* Class FloorAction
|
||||
* @package App\Events
|
||||
*/
|
||||
class FloorAction
|
||||
{
|
||||
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $floor_id;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $venue_id;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $summit_id;
|
||||
|
||||
/**
|
||||
* FloorAction constructor.
|
||||
* @param int $summit_id
|
||||
* @param int $venue_id
|
||||
* @param int $floor_id
|
||||
*/
|
||||
public function __construct($summit_id, $venue_id, $floor_id)
|
||||
{
|
||||
$this->summit_id = $summit_id;
|
||||
$this->venue_id = $venue_id;
|
||||
$this->floor_id = $floor_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getFloorId()
|
||||
{
|
||||
return $this->floor_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getVenueId()
|
||||
{
|
||||
return $this->venue_id;
|
||||
}
|
||||
|
||||
public function getSummitId(){
|
||||
return $this->summit_id;
|
||||
}
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class FloorDeleted
|
||||
* @package App\Events
|
||||
*/
|
||||
final class FloorDeleted extends FloorAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class FloorInserted
|
||||
* @package App\Events
|
||||
*/
|
||||
final class FloorInserted extends FloorAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class FloorUpdated
|
||||
* @package App\Events
|
||||
*/
|
||||
final class FloorUpdated extends FloorAction
|
||||
{
|
||||
|
||||
}
|
@ -1,95 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
/**
|
||||
* Class LocationAction
|
||||
* @package App\Events
|
||||
*/
|
||||
class LocationAction
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $location_id;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $summit_id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $location_class_name;
|
||||
|
||||
/**
|
||||
* @var int[]
|
||||
*/
|
||||
private $related_event_ids;
|
||||
|
||||
/**
|
||||
* LocationUpdated constructor.
|
||||
* @param int $summit_id
|
||||
* @param int $location_id
|
||||
* @param string $location_class_name
|
||||
* @param int[] $related_event_ids
|
||||
*/
|
||||
public function __construct
|
||||
(
|
||||
$summit_id,
|
||||
$location_id,
|
||||
$location_class_name,
|
||||
array $related_event_ids = []
|
||||
)
|
||||
{
|
||||
$this->summit_id = $summit_id;
|
||||
$this->location_id = $location_id;
|
||||
$this->location_class_name = $location_class_name;
|
||||
$this->related_event_ids = $related_event_ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLocationId()
|
||||
{
|
||||
return $this->location_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int[]
|
||||
*/
|
||||
public function getRelatedEventIds()
|
||||
{
|
||||
return $this->related_event_ids;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getLocationClassName()
|
||||
{
|
||||
return $this->location_class_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSummitId()
|
||||
{
|
||||
return $this->summit_id;
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class LocationDeleted
|
||||
* @package App\Events
|
||||
*/
|
||||
final class LocationDeleted extends LocationAction
|
||||
{
|
||||
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
/**
|
||||
* Class LocationImageAction
|
||||
* @package App\Events
|
||||
*/
|
||||
class LocationImageAction
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $entity_id;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $location_id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $image_type;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $summit_id;
|
||||
|
||||
/**
|
||||
* LocationImageAction constructor.
|
||||
* @param int $entity_id
|
||||
* @param int $location_id
|
||||
* @param int $summit_id
|
||||
* @param string $image_type
|
||||
*/
|
||||
public function __construct($entity_id, $location_id, $summit_id, $image_type)
|
||||
{
|
||||
$this->entity_id = $entity_id;
|
||||
$this->location_id = $location_id;
|
||||
$this->summit_id = $summit_id;
|
||||
$this->image_type = $image_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getLocationId()
|
||||
{
|
||||
return $this->location_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getImageType()
|
||||
{
|
||||
return $this->image_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSummitId(){
|
||||
return $this->summit_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getEntityId(){
|
||||
return $this->entity_id;
|
||||
}
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class LocationImageDeleted
|
||||
* @package App\Events
|
||||
*/
|
||||
final class LocationImageDeleted extends LocationImageAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class LocationImageInserted
|
||||
* @package App\Events
|
||||
*/
|
||||
final class LocationImageInserted extends LocationImageAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class LocationImageUpdated
|
||||
* @package App\Events
|
||||
*/
|
||||
final class LocationImageUpdated extends LocationImageAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class LocationInserted
|
||||
* @package App\Events
|
||||
*/
|
||||
final class LocationInserted extends LocationAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class LocationUpdated
|
||||
* @package App\Events
|
||||
*/
|
||||
final class LocationUpdated extends LocationAction
|
||||
{
|
||||
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use models\main\Member;
|
||||
use models\summit\Summit;
|
||||
|
||||
|
||||
/**
|
||||
* Class MyFavoritesAdd
|
||||
* @package App\Events
|
||||
*/
|
||||
class MyFavoritesAdd extends SummitEventAction
|
||||
{
|
||||
/**
|
||||
* @var Member
|
||||
*/
|
||||
protected $member;
|
||||
|
||||
/**
|
||||
* @var Summit
|
||||
*/
|
||||
protected $summit;
|
||||
|
||||
/**
|
||||
* MyFavoritesAdd constructor.
|
||||
* @param Member $member
|
||||
* @param Summit $summit
|
||||
* @param int $event_id
|
||||
*/
|
||||
public function __construct($member, $summit, $event_id){
|
||||
|
||||
$this->member = $member;
|
||||
$this->summit = $summit;
|
||||
parent::__construct($event_id);
|
||||
}
|
||||
|
||||
public function getMember(){ return $this->member; }
|
||||
|
||||
public function getSummit(){ return $this->summit;}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class MyFavoritesRemove
|
||||
* @package App\Events
|
||||
*/
|
||||
class MyFavoritesRemove extends MyFavoritesAdd
|
||||
{
|
||||
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
|
||||
use models\main\Member;
|
||||
use models\summit\Summit;
|
||||
|
||||
/**
|
||||
* Class MyScheduleAdd
|
||||
* @package App\Events
|
||||
*/
|
||||
class MyScheduleAdd extends SummitEventAction
|
||||
{
|
||||
|
||||
/**
|
||||
* @var Member
|
||||
*/
|
||||
protected $member;
|
||||
|
||||
/**
|
||||
* @var Summit
|
||||
*/
|
||||
protected $summit;
|
||||
|
||||
|
||||
/**
|
||||
* MyScheduleAdd constructor.
|
||||
* @param Member $member
|
||||
* @param Summit $summit
|
||||
* @param int $event_id
|
||||
*/
|
||||
public function __construct($member, $summit, $event_id){
|
||||
|
||||
$this->member = $member;
|
||||
$this->summit = $summit;
|
||||
parent::__construct($event_id);
|
||||
}
|
||||
|
||||
public function getMember(){ return $this->member; }
|
||||
|
||||
public function getSummit(){ return $this->summit;}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class MyScheduleRemove
|
||||
* @package App\Events
|
||||
*/
|
||||
class MyScheduleRemove extends MyScheduleAdd
|
||||
{
|
||||
use SerializesModels;
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
/**
|
||||
* Class NewMember
|
||||
* @package App\Events
|
||||
*/
|
||||
final class NewMember
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $member_id;
|
||||
|
||||
/**
|
||||
* NewMember constructor.
|
||||
* @param int $member_id
|
||||
*/
|
||||
public function __construct(int $member_id)
|
||||
{
|
||||
$this->member_id = $member_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getMemberId(): int
|
||||
{
|
||||
return $this->member_id;
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2021 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use models\summit\PresentationActionType;
|
||||
/**
|
||||
* Class PresentationActionTypeCreated
|
||||
* @package App\Events
|
||||
*/
|
||||
final class PresentationActionTypeCreated extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var PresentationActionType
|
||||
*/
|
||||
private $action_type;
|
||||
|
||||
/**
|
||||
* PresentationMaterialCreated constructor.
|
||||
* @param PresentationActionType $action_type
|
||||
*/
|
||||
public function __construct(PresentationActionType $action_type)
|
||||
{
|
||||
$this->action_type = $action_type;
|
||||
}
|
||||
|
||||
public function getActionType():PresentationActionType{
|
||||
return $this->action_type;
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use models\summit\PresentationMaterial;
|
||||
|
||||
/**
|
||||
* Class PresentationVideoCreated
|
||||
* @package App\Events
|
||||
*/
|
||||
final class PresentationMaterialCreated extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var PresentationMaterial
|
||||
*/
|
||||
private $material;
|
||||
|
||||
/**
|
||||
* PresentationMaterialCreated constructor.
|
||||
* @param PresentationMaterial $material
|
||||
*/
|
||||
public function __construct(PresentationMaterial $material)
|
||||
{
|
||||
$this->material = $material;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PresentationMaterial
|
||||
*/
|
||||
public function getMaterial(){
|
||||
return $this->material;
|
||||
}
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use models\summit\Presentation;
|
||||
|
||||
/**
|
||||
* Class PresentationMaterialDeleted
|
||||
* @package App\Events
|
||||
*/
|
||||
class PresentationMaterialDeleted extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var Presentation
|
||||
*/
|
||||
private $presentation;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $material_id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $class_name;
|
||||
|
||||
|
||||
/**
|
||||
* PresentationMaterialDeleted constructor.
|
||||
* @param Presentation $presentation
|
||||
* @param int $material_id
|
||||
* @param string $class_name
|
||||
*/
|
||||
public function __construct(Presentation $presentation, $material_id, $class_name)
|
||||
{
|
||||
$this->presentation = $presentation;
|
||||
$this->material_id = $material_id;
|
||||
$this->class_name = $class_name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Presentation
|
||||
*/
|
||||
public function getPresentation(){
|
||||
return $this->presentation;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getMaterialId(){
|
||||
return $this->material_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getClassName(){
|
||||
return $this->class_name;
|
||||
}
|
||||
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2016 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use models\summit\PresentationMaterial;
|
||||
|
||||
/**
|
||||
* Class PresentationMaterialUpdated
|
||||
* @package App\Events
|
||||
*/
|
||||
class PresentationMaterialUpdated extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var PresentationMaterial
|
||||
*/
|
||||
private $material;
|
||||
|
||||
/**
|
||||
* PresentationMaterialUpdated constructor.
|
||||
* @param PresentationMaterial $material
|
||||
*/
|
||||
public function __construct(PresentationMaterial $material)
|
||||
{
|
||||
$this->material = $material;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PresentationMaterial
|
||||
*/
|
||||
public function getMaterial(){
|
||||
return $this->material;
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2017 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class PresentationSpeakerCreated
|
||||
* @package App\Events
|
||||
*/
|
||||
class PresentationSpeakerCreated extends PresentationSpeakerEntityStateChanged
|
||||
{
|
||||
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2017 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
/**
|
||||
* Class PresentationSpeakerDeleted
|
||||
* @package App\Events
|
||||
*/
|
||||
class PresentationSpeakerDeleted extends PresentationSpeakerEntityStateChanged
|
||||
{
|
||||
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2017 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use models\summit\PresentationSpeaker;
|
||||
/**
|
||||
* Class PresentationSpeakerEntityStateChanged
|
||||
* @package App\Events
|
||||
*/
|
||||
class PresentationSpeakerEntityStateChanged extends Event
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
|
||||
/**
|
||||
* @var PresentationSpeaker
|
||||
*/
|
||||
protected $speaker;
|
||||
|
||||
/**
|
||||
* @var LifecycleEventArgs
|
||||
*/
|
||||
protected $args;
|
||||
|
||||
/**
|
||||
* SummitEventEntityStateChanged constructor.
|
||||
* @param PresentationSpeaker|null $speaker
|
||||
* @param LifecycleEventArgs $args
|
||||
*/
|
||||
public function __construct(?PresentationSpeaker $speaker, LifecycleEventArgs $args)
|
||||
{
|
||||
$this->speaker = $speaker;
|
||||
$this->args = $args;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PresentationSpeaker|null
|
||||
*/
|
||||
public function getPresentationSpeaker()
|
||||
{
|
||||
return $this->speaker;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return LifecycleEventArgs
|
||||
*/
|
||||
public function getArgs()
|
||||
{
|
||||
return $this->args;
|
||||
}
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2017 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
/**
|
||||
* Class PresentationSpeakerUpdated
|
||||
* @package App\Events
|
||||
*/
|
||||
class PresentationSpeakerUpdated extends PresentationSpeakerEntityStateChanged
|
||||
{
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use models\main\Member;
|
||||
use models\summit\RSVP;
|
||||
/**
|
||||
* Class RSVPAction
|
||||
* @package App\Events
|
||||
*/
|
||||
class RSVPAction extends SummitEventAction
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $rsvp_id;
|
||||
|
||||
public function __construct(RSVP $rsvp){
|
||||
|
||||
$this->rsvp_id = $rsvp->getId();
|
||||
parent::__construct($rsvp->getEventId());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getRsvpId(): int
|
||||
{
|
||||
return $this->rsvp_id;
|
||||
}
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class RSVPAdd
|
||||
* @package App\Events
|
||||
*/
|
||||
class RSVPCreated extends RSVPAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2020 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class RSVPUpdated
|
||||
* @package App\Events
|
||||
*/
|
||||
class RSVPUpdated extends RSVPAction
|
||||
{
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class CreatedSummitRegistrationOrder
|
||||
* @package App\Events
|
||||
*/
|
||||
final class CreatedSummitRegistrationOrder extends SummitRegistrationOrderAction
|
||||
{
|
||||
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class OrderDeleted
|
||||
* @package App\Events
|
||||
*/
|
||||
class OrderDeleted extends SummitRegistrationOrderAction
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $tickets_to_return;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $promo_codes_to_return;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $summit_id;
|
||||
/**
|
||||
* OrderDeleted constructor.
|
||||
* @param int $order_id
|
||||
* @param int $summit_id
|
||||
* @param array $tickets_to_return
|
||||
* @param array $promo_codes_to_return
|
||||
*/
|
||||
public function __construct(int $order_id, int $summit_id, array $tickets_to_return, array $promo_codes_to_return)
|
||||
{
|
||||
parent::__construct($order_id);
|
||||
|
||||
$this->summit_id = $summit_id;
|
||||
$this->tickets_to_return = $tickets_to_return;
|
||||
$this->promo_codes_to_return = $promo_codes_to_return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getTicketsToReturn(): array
|
||||
{
|
||||
return $this->tickets_to_return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPromoCodesToReturn(): array
|
||||
{
|
||||
return $this->promo_codes_to_return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSummitId(): int
|
||||
{
|
||||
return $this->summit_id;
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class PaymentSummitRegistrationOrderConfirmed
|
||||
* @package App\Events
|
||||
*/
|
||||
final class PaymentSummitRegistrationOrderConfirmed extends SummitRegistrationOrderAction
|
||||
{
|
||||
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class RequestedSummitAttendeeTicketRefund
|
||||
* @package App\Events
|
||||
*/
|
||||
class RequestedSummitAttendeeTicketRefund extends SummitAttendeeTicketAction
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $days_before_event_starts;
|
||||
|
||||
/**
|
||||
* RequestedSummitAttendeeTicketRefund constructor.
|
||||
* @param int $order_id
|
||||
* @param int $days_before_event_starts
|
||||
*/
|
||||
public function __construct(int $order_id, int $days_before_event_starts)
|
||||
{
|
||||
parent::__construct($order_id);
|
||||
$this->days_before_event_starts = $days_before_event_starts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDaysBeforeEventStarts(): int
|
||||
{
|
||||
return $this->days_before_event_starts;
|
||||
}
|
||||
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class RequestedSummitOrderRefund
|
||||
* @package App\Events
|
||||
*/
|
||||
final class RequestedSummitOrderRefund extends SummitRegistrationOrderAction
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $days_before_event_starts;
|
||||
|
||||
/**
|
||||
* RequestedSummitOrderRefund constructor.
|
||||
* @param int $order_id
|
||||
* @param int $days_before_event_starts
|
||||
*/
|
||||
public function __construct(int $order_id, int $days_before_event_starts)
|
||||
{
|
||||
parent::__construct($order_id);
|
||||
$this->days_before_event_starts = $days_before_event_starts;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getDaysBeforeEventStarts(): int
|
||||
{
|
||||
return $this->days_before_event_starts;
|
||||
}
|
||||
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
/**
|
||||
* Class SummitAttendeeTicketAction
|
||||
* @package App\Events
|
||||
*/
|
||||
abstract class SummitAttendeeTicketAction
|
||||
{
|
||||
|
||||
use SerializesModels;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $ticket_id;
|
||||
|
||||
/**
|
||||
* BookableRoomReservationAction constructor.
|
||||
* @param int $order_id
|
||||
*/
|
||||
public function __construct(int $ticket_id)
|
||||
{
|
||||
$this->ticket_id = $ticket_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getTicketId(): int
|
||||
{
|
||||
return $this->ticket_id;
|
||||
}
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class SummitAttendeeTicketRefundAccepted
|
||||
* @package App\Events
|
||||
*/
|
||||
final class SummitAttendeeTicketRefundAccepted extends SummitAttendeeTicketAction
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $tickets_to_return;
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $promo_codes_to_return;
|
||||
|
||||
/**
|
||||
* SummitAttendeeTicketRefundAccepted constructor.
|
||||
* @param int $ticket_id
|
||||
* @param array $tickets_to_return
|
||||
* @param array $promo_codes_to_return
|
||||
*/
|
||||
public function __construct(int $ticket_id, array $tickets_to_return, array $promo_codes_to_return)
|
||||
{
|
||||
parent::__construct($ticket_id);
|
||||
$this->tickets_to_return = $tickets_to_return;
|
||||
$this->promo_codes_to_return = $promo_codes_to_return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getTicketsToReturn(): array
|
||||
{
|
||||
return $this->tickets_to_return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPromoCodesToReturn(): array
|
||||
{
|
||||
return $this->promo_codes_to_return;
|
||||
}
|
||||
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class SummitOrderCanceled
|
||||
* @package App\Events
|
||||
*/
|
||||
final class SummitOrderCanceled extends SummitRegistrationOrderAction
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $tickets_to_return;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $promo_codes_to_return;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $send_email;
|
||||
|
||||
/**
|
||||
* SummitOrderCanceled constructor.
|
||||
* @param int $order_id
|
||||
* @param bool $send_email
|
||||
* @param array $tickets_to_return
|
||||
* @param array $promo_codes_to_return
|
||||
*/
|
||||
public function __construct(int $order_id, bool $send_email, array $tickets_to_return, array $promo_codes_to_return)
|
||||
{
|
||||
parent::__construct($order_id);
|
||||
|
||||
$this->send_email = $send_email;
|
||||
$this->tickets_to_return = $tickets_to_return;
|
||||
$this->promo_codes_to_return = $promo_codes_to_return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldSendEmail(): bool
|
||||
{
|
||||
return $this->send_email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getTicketsToReturn(): array
|
||||
{
|
||||
return $this->tickets_to_return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPromoCodesToReturn(): array
|
||||
{
|
||||
return $this->promo_codes_to_return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
|
||||
/**
|
||||
* Class SummitOrderRefundAccepted
|
||||
* @package App\Events
|
||||
*/
|
||||
class SummitOrderRefundAccepted extends SummitRegistrationOrderAction
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $tickets_to_return;
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $promo_codes_to_return;
|
||||
|
||||
/**
|
||||
* SummitOrderRefundAccepted constructor.
|
||||
* @param int $order_id
|
||||
* @param array $tickets_to_return
|
||||
* @param array $promo_codes_to_return
|
||||
*/
|
||||
public function __construct(int $order_id, array $tickets_to_return, array $promo_codes_to_return)
|
||||
{
|
||||
parent::__construct($order_id);
|
||||
$this->promo_codes_to_return = $promo_codes_to_return;
|
||||
$this->tickets_to_return = $tickets_to_return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getTicketsToReturn(): array
|
||||
{
|
||||
return $this->tickets_to_return;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getPromoCodesToReturn(): array
|
||||
{
|
||||
return $this->promo_codes_to_return;
|
||||
}
|
||||
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2019 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
/**
|
||||
* Class SummitRegistrationOrderAction
|
||||
* @package App\Events
|
||||
*/
|
||||
abstract class SummitRegistrationOrderAction
|
||||
{
|
||||
|
||||
use SerializesModels;
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $order_id;
|
||||
|
||||
/**
|
||||
* BookableRoomReservationAction constructor.
|
||||
* @param int $order_id
|
||||
*/
|
||||
public function __construct(int $order_id)
|
||||
{
|
||||
$this->order_id = $order_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getOrderId(): int
|
||||
{
|
||||
return $this->order_id;
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
<?php namespace App\Events;
|
||||
/**
|
||||
* Copyright 2018 OpenStack Foundation
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
**/
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
* Class SummitAction
|
||||
* @package App\Events
|
||||
*/
|
||||
class SummitAction
|
||||
{
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
protected $summit_id;
|
||||
|
||||
/**
|
||||
* SummitAction constructor.
|
||||
* @param int $summit_id
|
||||
*/
|
||||
public function __construct($summit_id)
|
||||
{
|
||||
$this->summit_id = $summit_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getSummitId()
|
||||
{
|
||||
return $this->summit_id;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user