for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class PhotoGalleryBlockImage extends DataObject
{
/**
* @var string
*/
private static $singular_name = 'Gallery Image';
private static $plural_name = 'Gallery Images';
* @var array
private static $db = array(
'Title' => 'Varchar(255)',
'Content' => 'HTMLText',
'SortOrder' => 'Int',
);
private static $has_one = array(
'PhotoGallery' => 'PhotoGalleryBlock',
'Image' => 'Image',
private static $summary_fields = array(
'Image.CMSThumbnail' => 'Image',
'Title' => 'Title',
private static $searchable_fields = array(
'Title',
'Content',
private static $extensions = [
'VersionedDataObject'
];
* @return FieldList
public function getCMSFields()
$fields = parent::getCMSFields();
$fields->removeByName(array(
'SortOrder',
'PhotoGalleryID',
));
$image = $fields->dataFieldByName('Image')->setFolderName('Uploads/Blocks/PhotoGallery/');
$fields->insertBefore($image, 'Content');
'Content'
string
object<FormField>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
return $fields;
}
* @param null $member
*
* @return bool
public function canCreate($member = null)
return true;
public function canView($member = null)
public function canEdit($member = null)
public function canDelete($member = null)
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: