Makes a DidIt activity record.

@param string $pinId
@param string $comment
@param null|string $pathToImage
@return array
198721
public function tryIt($pinId, $comment, $pathToImage = null)
    {
        $data = $this->makeRequest($pinId, $comment, $pathToImage);

        $this->post(UrlBuilder::RESOURCE_TRY_PIN_CREATE, $data);

        return $this->getResponse()->getResponseData();
    }
359496
public function dispatchCommentDeleteEvent(Post $post, Comment $comment)
    {
        $event = new LogCommentDeleteEvent($post, $comment);

        return $this->dispatch($event);
    }
395420
private function addFile($pathToAdd, $fileName = null)
    {
        if (!$fileName) {
            $info = pathinfo($pathToAdd);
            $fileName = isset($info['extension']) ?
                $info['filename'].'.'.$info['extension'] :
                $info['filename'];
        }

        $this->repository->addFile($pathToAdd, $this->getInternalPath().$fileName);
    }
1279611
function _doVoid($oID, $note = '') {
    global $db, $doPayPal, $messageStack;
    $new_order_status = (int)MODULE_PAYMENT_PAYPALDP_REFUNDED_STATUS_ID;
    $doPayPal = $this->paypal_init();
    $voidNote = strip_tags(zen_db_input($_POST['voidnote']));
    $voidAuthID = trim(strip_tags(zen_db_input($_POST['voidauthid'])));
    if (isset($_POST['ordervoid']) && $_POST['ordervoid'] == MODULE_PAYMENT_PAYPAL_ENTRY_VOID_BUTTON_TEXT_FULL) {
      if (isset($_POST['voidconfirm']) && $_POST['voidconfirm'] == 'on') {
        $proceedToVoid = true;
      } else {
        $messageStack->add_session(MODULE_PAYMENT_PAYPALDP_TEXT_VOID_CONFIRM_ERROR, 'error');
      }
    }
    // look up history on this order from PayPal table
    $sql = "select * from " . TABLE_PAYPAL . " where order_id = :orderID  AND parent_txn_id = '' ";
    $sql = $db->bindVars($sql, ':orderID', $oID, 'integer');
    $sql = $db->bindVars($sql, ':transID', $voidAuthID, 'string');
    $zc_ppHist = $db->Execute($sql);
    if ($zc_ppHist->RecordCount() == 0) return false;
    $txnID = $zc_ppHist->fields['txn_id'];
    /**
     * Submit void request to PayPal
     */
    if ($proceedToVoid) {
      $response = $doPayPal->DoVoid($voidAuthID, $voidNote);
      $error = $this->_errorHandler($response, 'DoVoid');
      $new_order_status = ($new_order_status > 0 ? $new_order_status : 1);
      if (!$error) {
        // Success, so save the results
        $sql_data_array = array('orders_id' => (int)$oID,
                                'orders_status_id' => (int)$new_order_status,
                                'date_added' => 'now()',
                                'comments' => 'VOIDED. Trans ID: ' . urldecode($response['AUTHORIZATIONID']). $response['PNREF'] . (isset($response['PPREF']) ? "\nPPRef: " . $response['PPREF'] : '') . "\n" . $voidNote,
                                'customer_notified' => 0
                             );
        zen_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
        $db->Execute("update " . TABLE_ORDERS  . "
                      set orders_status = '" . (int)$new_order_status . "'
                      where orders_id = '" . (int)$oID . "'");
        $messageStack->add_session(sprintf(MODULE_PAYMENT_PAYPALDP_TEXT_VOID_INITIATED, urldecode($response['AUTHORIZATIONID']) . $response['PNREF']), 'success');
        return true;
      }
    }
  }
1305367
public function saveImage($pathToImage)
    {
        if (is_dir($pathToImage)) {
            $pathToImage = rtrim($pathToImage, '\/').DIRECTORY_SEPARATOR.$this->page.'.'.$this->outputFormat;
        }

        $imageData = $this->getImageData($pathToImage);

        return file_put_contents($pathToImage, $imageData) !== false;
    }
309631
protected function getRemoteImageData($pathToImage)
    {
        $this->imagick->readImage($this->pdfFile);

        $this->imagick->setIteratorIndex($this->page - 1);

        if (is_int($this->layerMethod)) {
            $this->imagick = $this->imagick->mergeImageLayers($this->layerMethod);
        }

        $this->imagick->setFormat($this->determineOutputFormat($pathToImage));

        return $this->imagick;
    }
305725
public function comment($spaceId, $threadId, $comment, array $mentions = [], array $files = [], $guestSpaceId = null): array
    {
        $options = ['json' => [
            'space'  => $spaceId,
            'thread' => $threadId,
            'comment'  => [
                'text' => $comment,
                'mentions' => $mentions,
                'files' => $files
            ],
        ]];

        /** @var JsonStream $stream */
        $stream = $this->client
            ->post(KintoneApi::generateUrl('space/thread/comment.json', $guestSpaceId), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
111054
public function add($pathToAdd, $fileName = null)
    {
        if (is_array($pathToAdd)) {
            foreach ($pathToAdd as $key=>$dir) {
                if (!is_int($key)) {
                    $this->add($dir, $key); }
                else {
                    $this->add($dir);
                }
            }
        } elseif ($this->file->isFile($pathToAdd)) {
            if ($fileName) {
                $this->addFile($pathToAdd, $fileName);
            } else {
                $this->addFile($pathToAdd);
            }
        } else {
            $this->addDir($pathToAdd);
        }

        return $this;
    }
1092011
public function actionAutosavePost($id=NULL)
	{
		$model = $this->loadModel($id);

		if (!$this->user->role->hasPermission('modify'))
			throw new CHttpException(403, Yii::t('Api.content', 'You do not have permission to create new entries.'));

		$model->populate($_POST);

		if ($this->user->role->isA('author') || $this->user->role->isA('collaborator'))
			$model->author_id = $this->user->id;

		$asModel = $model->getPrototype('ContentMetadata', array('content_id' => $model->id, 'key' => 'autosave'));

		$asModel->value = CJSON::encode($model->attributes);
		
		if ($asModel->save())
			return true;
		else
			return $this->returnError(400, NULL, $asModel->getErrors());
	}
209299
public function insert($activityId, Google_Comment $postBody, $optParams = array()) {
      $params = array('activityId' => $activityId, 'postBody' => $postBody);
      $params = array_merge($params, $optParams);
      $data = $this->__call('insert', array($params));
      if ($this->useObjects()) {
        return new Google_Comment($data);
      } else {
        return $data;
      }
    }
1313266
public function getCommentsForPost($post_id)
    {
        $this->checkId($post_id);

        return $this->adapter->get(sprintf('/comments/%d', $post_id));
    }
354654
def toto(arch_name, comment='', clear=False, read_comment=False, list_members=False, time_show=False):
    
    if comment and clear:
        clingon.RunnerError("You cannot specify --comment and --clear together")
    z = None
    # if archive does not exist, create it with up to 3 files from current directory
    if not os.path.isfile(arch_name):
        print "Creating archive", arch_name
        z = zipfile.ZipFile(arch_name, 'w')
        for f in [x for x in glob.iglob('*.*') if not x.endswith('.zip')][:3]:
            print "  Add file %s to %s" % (f, arch_name)
            z.write(f)
    if comment:
        mtime = os.path.getmtime(arch_name)
        if not z:
            z = zipfile.ZipFile(arch_name, 'a')
        z.comment = comment
    if z:
        z.close()
        if comment:
            os.utime(arch_name, (time.time(), mtime))
    if read_comment:
        z = zipfile.ZipFile(arch_name, 'r')
        print "Comment:", z.comment, len(z.comment)
    if list_members:
        z = zipfile.ZipFile(arch_name, 'r')
        print "Members:", z.namelist()
    if time_show:
        print "Access time:", time.ctime(os.path.getatime(arch_name))
        print "Modif time:", time.ctime(os.path.getmtime(arch_name))
348898
public function create($pinId, $text)
    {
        $requestOptions = [
            'objectId' => $this->getAggregatedPinId($pinId),
            'pinId'    => $pinId,
            'text'     => $text,
        ];

        return $this->post(UrlBuilder::RESOURCE_COMMENT_PIN, $requestOptions, true);
    }
381917
public function writeComment(string $comment): XmlStreamWriter
    {
        return $this->append(
                function(\DOMNode $parent) use ($comment)
                {
                    $parent->appendChild(
                            $this->doc->createComment($this->encode($comment))
                    );
                },
                'comment'
        );
    }
29601
public function postComment(int $blogArticleId, string $authorName, EmailAddress $authorEmail, string $comment): BlogArticleComment
    {
        $blogArticle = $this->blogArticleRepo->get($blogArticleId);

        $comment = $blogArticle->postComment($authorName, $authorEmail, $comment, $this->clock);

        $this->blogArticleRepo->save($blogArticle);

        return $comment;
    }
113557
public function addComment($postId, $comment)
	{
		$token = $this->oauth->getToken();

		// Set parameters.
		$parameters = array(
			'oauth_token' => $token['key'],
		);

		// Set the success response code.
		$this->oauth->setOption('success_code', 201);

		// Set the API base
		$base = '/v1/posts/' . $postId . '/comments';

		// Build xml.
		$xml = '<comment><text>' . $comment . '</text></comment>';

		// Build the request path.
		$path = $this->getOption('api.url') . $base;

		$header['Content-Type'] = 'text/xml';

		// Send the request.
		$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);

		// Return the comment id.
		$response = explode('comments/', $response->headers['Location']);

		return $response[1];
	}
507172
public function postComment($post_id, $text, $comment_id = 0)
    {
        $this->checkId($post_id);

        $params = [
            'text' => $text,
            'parent_id' => $comment_id
        ];

        return $this->adapter->put(sprintf('/comments/%d', $post_id), $params);
    }