1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
invoiceninja/app/Console/Commands/stubs/transformer.stub
Louis-Rémi Babé 9f1df5e924 Fix remaining swagger docs errors
+ Take @hillelcoren remarks into account
2017-03-09 11:11:45 +01:00

36 lines
1.1 KiB
Plaintext

<?php
namespace $NAMESPACE$;
use Modules\$STUDLY_NAME$\Models\$STUDLY_NAME$;
use App\Ninja\Transformers\EntityTransformer;
/**
* @SWG\Definition(definition="$STUDLY_NAME$", @SWG\Xml(name="$STUDLY_NAME$"))
*/
class $STUDLY_NAME$Transformer extends EntityTransformer
{
/**
* @SWG\Property(property="id", type="integer", example=1, readOnly=true)
* @SWG\Property(property="user_id", type="integer", example=1)
* @SWG\Property(property="account_key", type="string", example="123456")
* @SWG\Property(property="updated_at", type="integer", example=1451160233, readOnly=true)
* @SWG\Property(property="archived_at", type="integer", example=1451160233, readOnly=true)
*/
/**
* @param $STUDLY_NAME$ $$LOWER_NAME$
* @return array
*/
public function transform($STUDLY_NAME$ $$LOWER_NAME$)
{
return array_merge($this->getDefaults($$LOWER_NAME$), [
$TRANSFORMER_FIELDS$
'id' => (int) $$LOWER_NAME$->public_id,
'updated_at' => $this->getTimestamp($$LOWER_NAME$->updated_at),
'archived_at' => $this->getTimestamp($$LOWER_NAME$->deleted_at),
]);
}
}