コード例 #1
0
 protected function newEditType()
 {
     $type = parent::newEditType();
     $datasource = $this->newDatasource()->setViewer($this->getViewer());
     $type->setDatasource($datasource);
     return $type;
 }
コード例 #2
0
 public function getCommentEditTypes()
 {
     if (!$this->getUseEdgeTransactions()) {
         return parent::getCommentEditTypes();
     }
     $transaction_type = $this->getTransactionType();
     if ($transaction_type === null) {
         return array();
     }
     $label = $this->getCommentActionLabel();
     if ($label === null) {
         return array();
     }
     $type_key = $this->getEditTypeKey();
     $base = $this->getEditType();
     $add = id(clone $base)->setEditType($type_key . '.add')->setEdgeOperation('+')->setLabel($label);
     return array($add);
 }