chore: sync module from working instance and add install guide
This commit is contained in:
32
events/AnimalTileSizeEvent.php
Normal file
32
events/AnimalTileSizeEvent.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace humhub\modules\animal_management\events;
|
||||
|
||||
use humhub\modules\animal_management\models\Animal;
|
||||
use humhub\modules\content\components\ContentContainerActiveRecord;
|
||||
use yii\base\Event;
|
||||
|
||||
class AnimalTileSizeEvent extends Event
|
||||
{
|
||||
public const EVENT_RESOLVE_SIZE = 'resolveSize';
|
||||
|
||||
public Animal $animal;
|
||||
public ContentContainerActiveRecord $contentContainer;
|
||||
public $existingDonationGoal = null;
|
||||
|
||||
private int $additionalHeightPx = 0;
|
||||
|
||||
public function addAdditionalHeightPx(int $heightPx): void
|
||||
{
|
||||
if ($heightPx <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->additionalHeightPx += $heightPx;
|
||||
}
|
||||
|
||||
public function getAdditionalHeightPx(): int
|
||||
{
|
||||
return max(0, $this->additionalHeightPx);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user