HighSpeaker/vendor/illuminate/contracts/Database/Eloquent/CastsAttributes.php

33 lines
803 B
PHP
Raw Normal View History

2022-12-24 19:40:40 +05:30
<?php
namespace Illuminate\Contracts\Database\Eloquent;
2024-01-31 19:45:08 +05:30
/**
* @template TGet
* @template TSet
*/
2022-12-24 19:40:40 +05:30
interface CastsAttributes
{
/**
* Transform the attribute from the underlying model values.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $key
* @param mixed $value
* @param array $attributes
2024-01-31 19:45:08 +05:30
* @return TGet|null
2022-12-24 19:40:40 +05:30
*/
public function get($model, string $key, $value, array $attributes);
/**
* Transform the attribute to its underlying model values.
*
* @param \Illuminate\Database\Eloquent\Model $model
* @param string $key
2024-01-31 19:45:08 +05:30
* @param TSet|null $value
2022-12-24 19:40:40 +05:30
* @param array $attributes
* @return mixed
*/
public function set($model, string $key, $value, array $attributes);
}