1. Go to this page and download the library: Download activecollab/databaseobject 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/ */
$container = new Container([
'dependency' => 'it works!',
]);
$pool->setContainer($container);
foreach ($pool->find(Writer::class)->all() as $writer) {
print $writer->dependency . "\n"; // Prints it works!
}
use ActiveCollab\DatabaseObject\Entity\Entity;
class StatsSnapshot extends Entity
{
/**
* Generated fields that are loaded, but not managed by the entity.
*
* @var array
*/
protected $generated_fields = ['is_used_on_day', 'plan_name', 'number_of_users'];
/**
* Return value of is_used_on_day field.
*
* @return bool
*/
public function isUsedOnDay()
{
return $this->getFieldValue('is_used_on_day');
}
/**
* Return value of is_used_on_day field.
*
* @return bool
* @deprecated use isUsedOnDay()
*/
public function getIsUsedOnDay()
{
return $this->getFieldValue('is_used_on_day');
}
/**
* Return value of plan_name field.
*
* @return string
*/
public function getPlanName()
{
return $this->getFieldValue('plan_name');
}
/**
* Return value of number_of_users field.
*
* @return int
*/
public function getNumberOfUsers()
{
return $this->getFieldValue('number_of_users');
}
}
use ActiveCollab\DatabaseConnection\Record\ValueCaster;
use ActiveCollab\DatabaseConnection\Record\ValueCasterInterface;
use ActiveCollab\DatabaseObject\Entity\Entity;
class StatsSnapshot extends Entity
{
protected function configure(): void
{
$this->setGeneratedFieldsValueCaster(new ValueCaster([
'is_used_on_day' => ValueCasterInterface::CAST_BOOL,
'plan_name' => ValueCasterInterface::CAST_STRING,
'number_of_users' => ValueCasterInterface::CAST_INT,
]));
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.