PHP code example of arm-cm / task-memory

1. Go to this page and download the library: Download arm-cm/task-memory library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

arm-cm / task-memory example snippets




rmCm\TaskMemory\Task;
use ArmCm\TaskMemory\TaskCollection;

$task = new Task('Write demo', 'Create a usage example');

$collection = new TaskCollection();
$collection->add($task);

print_r($collection->toArray());

echo $collection->toJson();

use ArmCm\TaskMemory\Task;

$task = new Task('Title', 'Description');

$task->done();
$task->starting();
$task->currentStatus()

$task->update('New title', 'New description');
$task->update('New title');

use ArmCm\TaskMemory\TaskCollection;

$collection = new TaskCollection();

$collection->add(Task|array $tasks) — Adds one or more Task objects to the collection

$collection->all(): array — Returns all tasks as an array of Task objects

$collection->count(): int — Returns the total number of tasks in the collection

$collection->findBy(string $attribute, string|int $value): array — Returns all tasks that match the given parameters

$collection->toArray(): array — Converts the task collection to an associative array

$collection->toJson(): string — Converts the task collection to a JSON string

demo-task-app/
├── vendor/
├── composer.json
└── index.php

php index.php