31 lines
698 B
PHP
31 lines
698 B
PHP
<?php
|
|
|
|
namespace App\Models\Virtual;
|
|
|
|
use App\Core\Model;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
class FlowPoolCard extends Model
|
|
{
|
|
protected $table = 'virtual_flow_pool_cards';
|
|
|
|
protected $primaryKey = ['pool_id', 'sim'];
|
|
|
|
public $incrementing = false;
|
|
|
|
/**
|
|
* Set the keys for a save update query.
|
|
*
|
|
* @param \Illuminate\Database\Eloquent\Builder $query
|
|
* @return \Illuminate\Database\Eloquent\Builder
|
|
*/
|
|
protected function setKeysForSaveQuery(Builder $query)
|
|
{
|
|
foreach ($this->getKeyName() as $key) {
|
|
$query->where($key, '=', $this->original[$key] ?? $this->getAttribute($key));
|
|
}
|
|
|
|
return $query;
|
|
}
|
|
}
|