public function __construct(ICache $cache, $contact) { if (!$contact instanceof ContactObject) { throw new \Exception(__METHOD__ . ' Second argument must be an instance of OCA\\Contacts\\Contact'); } parent::__construct($cache); $this->contact = $contact; $this->processImage(); }
public function __construct(ICache $cache, $userId) { parent::__construct($cache); // check if userId is a real ownCloud user if (!in_array($userId, \OCP\User::getUsers())) { throw new \Exception('Second argument must be an ownCloud user ID'); } $this->userId = $userId; $this->processImage(); }
public function __construct(ICache $cache, IRequest $request) { \OCP\Util::writeLog('contacts', __METHOD__, \OCP\Util::DEBUG); if (!$request instanceof IRequest) { throw new \Exception(__METHOD__ . ' Second argument must be an instance of \\OCP\\IRequest'); } parent::__construct($cache); $this->request = $request; $this->processImage(); }
public function __construct(ICache $cache, $path) { \OCP\Util::writeLog('contacts', __METHOD__ . ' path: ' . $path, \OCP\Util::DEBUG); if (!is_string($path)) { throw new \Exception(__METHOD__ . ' Second argument must a string'); } parent::__construct($cache); $this->path = $path; $this->processImage(); }