for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Helix\Asana\Project;
use Helix\Asana\Base\AbstractEntity;
use Helix\Asana\Base\AbstractEntity\CrudTrait;
use Helix\Asana\Project;
use Helix\Asana\Task;
/**
* A project section.
*
* @see https://developers.asana.com/docs/#asana-sections
* @see https://developers.asana.com/docs/#tocS_Section
* @method string getCreatedAt ()
* @method string getName ()
* @method $this setName (string $name)
* @method Project getProject ()
*/
class Section extends AbstractEntity {
use CrudTrait;
const TYPE = 'section';
final public function __toString (): string {
return "sections/{$this->getGid()}";
}
final protected function _getDir (): string {
return "{$this->getProject()}/sections";
protected function _getMap (): array {
return [
'project' => Project::class
];
* @return Task[]
public function getTasks () {
return $this->loadAll(Task::class, 'tasks', ['section' => $this->getGid()]);
* Instantiates and returns a new task.
* @depends after-create
* @return Task
public function newTask () {
/** @var Task $task */
$task = $this->factory(Task::class);
return $task->addToProject($this);