1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/app/models/Product.php

17 lines
349 B
PHP
Raw Normal View History

2013-11-26 13:45:07 +01:00
<?php
2013-12-04 17:20:14 +01:00
class Product extends EntityModel
2013-12-31 10:43:39 +01:00
{
2013-12-03 18:32:33 +01:00
public static function findProductByKey($key)
{
2013-12-04 17:20:14 +01:00
return Product::scope()->where('product_key','=',$key)->first();
}
public static function getProductKeys($products)
{
2013-12-04 17:20:14 +01:00
$products = array_pluck($products, 'product_key');
$products = array_combine($products, $products);
return $products;
}
2013-11-26 13:45:07 +01:00
}