26/02/2017 8:20am

PHP | Problem -


<?php


class ImageBlock extends DataObject
{

private static $has_one = [
'Parent' => 'ImageBlockHolder'
];

}

abstract class ImageBlockHolder extends DataObject
{
private static $has_many = [
'ImageBlocks' => 'ImageBlock'
];
}


class SomeDataObject extends ImageBlockHolder
{

}

class AnotherDataObject extends ImageBlockHolder
{

}