You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LuModel.php 1.4KB

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