mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +01:00
24 lines
475 B
PHP
Executable File
24 lines
475 B
PHP
Executable File
<?php
|
|
|
|
class Product extends Eloquent
|
|
{
|
|
protected $softDelete = true;
|
|
|
|
public static function getProducts()
|
|
{
|
|
return Product::where('account_id','=',Auth::user()->account_id);
|
|
}
|
|
|
|
public static function findProduct($key)
|
|
{
|
|
return Product::getProducts()->where('key','=',$key)->first();
|
|
}
|
|
|
|
public static function getProductKeys($products)
|
|
{
|
|
$products = array_pluck($products, 'key');
|
|
$products = array_combine($products, $products);
|
|
|
|
return $products;
|
|
}
|
|
} |