Changeset View
Changeset View
Standalone View
Standalone View
src/applications/phrequent/conduit/ConduitAPI_phrequent_Method.php
- This file was added.
<?php | |||||
/** | |||||
* @group conduit | |||||
*/ | |||||
abstract class ConduitAPI_phrequent_Method extends ConduitAPIMethod { | |||||
public function getApplication() { | |||||
return | |||||
PhabricatorApplication::getByClass('PhabricatorApplicationPhrequent'); | |||||
} | |||||
public function getMethodStatus() { | |||||
return self::METHOD_STATUS_UNSTABLE; | |||||
} | |||||
public function getMethodStatusDescription() { | |||||
return pht('Phrequent is still in beta. | |||||
The Conduit API was recently added and still under development.'); | |||||
} | |||||
protected function buildBlockDictionary(array $blocks) { | |||||
$result = array(); | |||||
assert_instances_of($blocks, 'PhrequentUserTime'); | |||||
if (!$blocks) { | |||||
return array(); | |||||
} | |||||
foreach ($blocks as $block) { | |||||
$result[$block->getID()] = array( | |||||
'id' => $block->getID(), | |||||
'userPHID' => $block->getUserPHID(), | |||||
'objectPHID' => $block->getObjectPHID(), | |||||
'note' => $block->getNote(), | |||||
'dateStarted' => $block->getDateStarted(), | |||||
'dateEnded' => $block->getDateEnded(), | |||||
'dateCreated' => $block->getDateCreated(), | |||||
'dateModified' => $block->getDateModified()); | |||||
} | |||||
return $result; | |||||
} | |||||
} |