if (!
$emotion) { $this->
View()->
assign([ 'success' => false,
'data' =>
$this->
Request()->
getParams(),
'message' =>
$namespace->
get('no_valid_id', 'No valid emotion id passed.'
),
]);
return null;
} } else { $emotion =
new Emotion();
$emotion->
setCreateDate(new DateTime());
} $template = null;
if (!
empty($data['templateId'
])) { $template =
$this->
get('models'
)->
find(Template::
class,
$data['templateId'
]);
} $validFrom = null;
if (!
empty($data['validFrom'
]) && !
empty($data['validFromTime'
])) {