This commit is contained in:
2022-05-18 17:40:18 +02:00
parent 7b3a698daa
commit 4156db2cdc
8 changed files with 201 additions and 387 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace Bluesquare\Connect\Traits;
trait HasConnectData
{
public static $connectIdentifier = 'connect_id';
protected $connectFillable = [];
public function fillConnectData(array $data)
{
foreach ($this->connectFillable as $origin => $target) {
if (is_string($origin)) {
$this->$target = $data[$origin] ?? null;
} else {
$this->$target = $data[$target] ?? null;
}
}
}
abstract public function fill(array $attributes);
}