選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

LuModel.php 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace Luticate\Utils;
  3. use Illuminate\Database\Eloquent\Collection;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Luticate\Utils\Dbo\LuDbo;
  6. /**
  7. * LuModel
  8. *
  9. * @method static LuModel where($column, $operator = null, $value = null, $boolean = 'and')
  10. * @method static LuModel orWhere($column, $operator = null, $value = null)
  11. * @method static LuModel orderBy($column, $direction = 'asc')
  12. * @method static LuModel take($value)
  13. * @method static LuModel offset($value)
  14. * @method static LuModel rightJoin($table, $first, $operator = null, $second = null)
  15. * @method static LuModel leftJoin($table, $first, $operator = null, $second = null)
  16. * @method static LuModel join($table, $one, $operator = null, $two = null, $type = 'inner', $where = false)
  17. * @method static LuModel groupBy(...$columns)
  18. * @method static LuModel[] get($columns = ['*'])
  19. * @method static LuModel first($columns = ['*'])
  20. * @method static LuModel find($id, $columns = ['*'])
  21. * @method static LuModel select($columns = ['*'])
  22. * @method static int count($columns = '*')
  23. */
  24. abstract class LuModel extends Model
  25. {
  26. /**
  27. * Mapping from DBO model to business model.
  28. * If this model has no DBO equivalent, do nothing in this function
  29. * @return LuDbo
  30. */
  31. public abstract function toDbo();
  32. /**
  33. * @param $dbo LuDbo
  34. * @param $dal LuModel|null
  35. * @return LuModel
  36. */
  37. public abstract function fromDbo($dbo, $dal = null);
  38. }