ldc-dam/app/Models/ArcadiaLink.php
Jérémy Munsch 3adefc6fdc
Ticket 754: Rewrite Arcadia Xml in job:
- composer require kwaadpepper/enum
- add MAIL_LIST_SERVICEWEB var to .env
- add XmlJobs, XArcadiaFlux
- ArcadiaLink is now a Job instead of a simple comand
- Add real progressbar to XArcadiaFlux
- Add XmlArcadiaMediasIn to Kernel to execute twice daily on one server
- Add Lib\Utils class with sendEmailErrorManually until laravel bump is done
- Changed XmlJobs can now handle xml files which have only one entity within
- Add guessed XSD
- Changed XmlJobs can now validate xml with xsd before parse
- Changed XmlJobs Report Query Exceptions on save
- Added XmlJobs Add save callback to handle save
- Extensive tests
2022-03-25 13:59:30 +01:00

52 lines
1,018 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Carbon\Carbon;
class ArcadiaLink extends Model
{
/**
* *The table associated with the model.
*
* @var string
*/
protected $table = 'arcadia_link';
// * GETTERS
/**
* Get dateF attribute
*
* @return string
* @phpcs:disable Generic.NamingConventions.CamelCapsFunctionName.ScopeNotCamelCaps
*/
public function getDateFAttribute()
{
return Carbon::createFromFormat('Y-m-d H:i:s', $this->created_at)->format('d/m/Y H:i:s');
}
/**
* Get mediaUuid attribute
*
* @return string|null
*/
public function getMediaUuidAttribute()
{
$m = Media::find($this->media_id);
return $m->uid;
}
// * RELATIONSHIPS
/**
* BelongsTo media relation
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function media()
{
return $this->belongsTo(Media::class);
}
}