Skip to content

Instantly share code, notes, and snippets.

@iolloyd
Created March 4, 2016 20:29
Show Gist options
  • Save iolloyd/f366f6fa831f00ef9e7b to your computer and use it in GitHub Desktop.
Save iolloyd/f366f6fa831f00ef9e7b to your computer and use it in GitHub Desktop.
defining a relationship
<?php
namespace API\Service\Command;
use API\Service\CommandService;
class ContentCommandService extends CommandService
{
protected $hasMany = 'Asset';
protected $uses = 'ContentMapping';
public function create(array $params, $userId = false) {
$id = parent::create($params, $userId);
return $id;
}
public function modify($id, array $params, $userId = false) {
$id = parent::modify($id, $params, $userId);
return $id;
}
public function remove($id, $userId = false) {
$success = parent::remove($id, $userId);
return $success;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment