Skip to content

Commit

Permalink
DOC Update PHPDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Feb 12, 2024
1 parent 28b833f commit c5f91c4
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 22 deletions.
11 changes: 7 additions & 4 deletions src/Form/AbstractLinkField.php
Expand Up @@ -40,8 +40,11 @@ public function getExcludeLinkTextField(): bool
}

/**
* Set allowed types for LinkField
* Set which types of link are allowed for this field.
* Types must be FQCN of Link subclasses.
*
* @param string[] $types
* @throws InvalidArgumentException if $types is empty or any type in the array is invalid
*/
public function setAllowedTypes(array $types): static
{
Expand All @@ -51,17 +54,17 @@ public function setAllowedTypes(array $types): static
}

/**
* Get allowed types for LinkField
* Get the types of link which are allowed for this field.
*/
public function getAllowedTypes(): array
{
return $this->allowedTypes;
}

/**
* The method returns an associational array converted to a JSON string,
* The method returns a stringified JSON object
* of available link types with additional parameters necessary
* for full-fledged work on the client side.
* for work on the client side.
* @throws InvalidArgumentException
*/
public function getTypesProp(): string
Expand Down
3 changes: 0 additions & 3 deletions src/Models/EmailLink.php
Expand Up @@ -20,9 +20,6 @@ class EmailLink extends Link
'Email' => 'Varchar(255)',
];

/**
* Set the priority of this link type in the CMS menu
*/
private static int $menu_priority = 30;

private static $icon = 'font-icon-p-mail';
Expand Down
3 changes: 0 additions & 3 deletions src/Models/ExternalLink.php
Expand Up @@ -20,9 +20,6 @@ class ExternalLink extends Link
'ExternalUrl' => 'Varchar',
];

/**
* Set the priority of this link type in the CMS menu
*/
private static int $menu_priority = 20;

private static $icon = 'font-icon-external-link';
Expand Down
3 changes: 0 additions & 3 deletions src/Models/FileLink.php
Expand Up @@ -21,9 +21,6 @@ class FileLink extends Link
'File' => File::class,
];

/**
* Set the priority of this link type in the CMS menu
*/
private static int $menu_priority = 10;

private static $icon = 'font-icon-image';
Expand Down
5 changes: 3 additions & 2 deletions src/Models/Link.php
Expand Up @@ -18,7 +18,7 @@
use SilverStripe\Forms\Tip;

/**
* A Link Data Object. This class should be treated as abstract. You should never directly interact with a plain Link
* A Link DataObject. This class should be treated as abstract. You should never directly interact with a plain Link
* instance
*
* Note that links should be added via a has_one or has_many relation, NEVER a many_many relation. This is because
Expand Down Expand Up @@ -62,7 +62,8 @@ class Link extends DataObject
private ?string $linkType = null;

/**
* Set the priority of this link type in the CMS menu
* Set the priority of this link type in the link picker.
* A link with a higher priority value will be displayed lower in the list.
*/
private static int $menu_priority = 100;

Expand Down
5 changes: 1 addition & 4 deletions src/Models/PhoneLink.php
Expand Up @@ -17,11 +17,8 @@ class PhoneLink extends Link
'Phone' => 'Varchar(255)',
];

/**
* Set the priority of this link type in the CMS menu
*/
private static int $menu_priority = 40;

private static $icon = 'font-icon-mobile';

public function getCMSFields(): FieldList
Expand Down
3 changes: 0 additions & 3 deletions src/Models/SiteTreeLink.php
Expand Up @@ -33,9 +33,6 @@ class SiteTreeLink extends Link
'Page' => SiteTree::class,
];

/**
* Set the priority of this link type in the CMS menu
*/
private static int $menu_priority = 0;

private static $icon = 'font-icon-page';
Expand Down

0 comments on commit c5f91c4

Please sign in to comment.