Doctrine SINGLE TABLE inheritance #4937

Closed
opened 2026-01-22 14:53:09 +01:00 by admin · 9 comments
Owner

Originally created by @ghost on GitHub (Dec 15, 2015).

Originally assigned to: @Ocramius on GitHub.

/**
     * @ORM\Column(type="integer", options={"default" = 0})
     */
    private $soft_views_yesterday = 0;

    /**
     * @ORM\Column(type="integer", nullable=FALSE, options={"default" = 0})
     */
    private $views_yesterday = 0;

   /**
     * @ORM\Column(type="integer", options={"default" = 0})
     */
    private $flag_growth = 0;

Hi I have extended an entity and it seems every field that I pass into it whether I add the nullable tag still keeps it as allow null in the table structure.

Also on a side note when I am creating the entity I use the generated setter and it ignore the value I change it to.

$entity->setFlagGrowth(1);
$entity->setFlagYield(1);
$entity->setFlagPricePaid(1);
$entity->setFlagScore(1);
$entity->setFlagValuation(1);

Any help will be amazing as this is making me fall into the deep depths of doctrine depression.

Thanks,

Harry

Originally created by @ghost on GitHub (Dec 15, 2015). Originally assigned to: @Ocramius on GitHub. <pre> /** * @ORM\Column(type="integer", options={"default" = 0}) */ private $soft_views_yesterday = 0; /** * @ORM\Column(type="integer", nullable=FALSE, options={"default" = 0}) */ private $views_yesterday = 0; /** * @ORM\Column(type="integer", options={"default" = 0}) */ private $flag_growth = 0; </pre> Hi I have extended an entity and it seems every field that I pass into it whether I add the nullable tag still keeps it as allow null in the table structure. Also on a side note when I am creating the entity I use the generated setter and it ignore the value I change it to. <pre> $entity->setFlagGrowth(1); $entity->setFlagYield(1); $entity->setFlagPricePaid(1); $entity->setFlagScore(1); $entity->setFlagValuation(1); </pre> Any help will be amazing as this is making me fall into the deep depths of doctrine depression. Thanks, Harry
admin added the Invalid label 2026-01-22 14:53:09 +01:00
admin closed this issue 2026-01-22 14:53:09 +01:00
Author
Owner

@DHager commented on GitHub (Dec 15, 2015):

I have extended an entity

I assume that means there are two PHP classes that each contain Doctrine metadata (e.g. annotations) What do the parent/child both look like?

@DHager commented on GitHub (Dec 15, 2015): > I have extended an entity I assume that means there are two PHP classes that each contain Doctrine metadata (e.g. annotations) What do the parent/child both look like?
Author
Owner

@ghost commented on GitHub (Dec 15, 2015):

Here are the two entities

This is the base one:

<?php
namespace Minos\Bundle\PropertyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping\InheritanceType;
use Doctrine\ORM\Mapping\JoinTable;

/**
 * @ORM\Entity
 * @InheritanceType("SINGLE_TABLE")
 *
 * @ORM\HasLifecycleCallbacks
 *
 * @ORM\Table(name="property_data", indexes={
 *      @ORM\Index(name="listing_status", columns={"listing_status"}),
 *      @ORM\Index(name="reference", columns={"reference"}),
 *      @ORM\Index(name="listing_type", columns={"listing_type"}),
 *      @ORM\Index(name="status", columns={"status"}),
 *      @ORM\Index(name="council_id", columns={"council_id"}),
 *      @ORM\Index(name="county_id", columns={"county_id"}),
 *      @ORM\Index(name="town_id", columns={"town_id"}),
 *      @ORM\Index(name="region_id", columns={"region_id"}),
 *      @ORM\Index(name="postcode_id", columns={"postcode_id"}),
 *      @ORM\Index(name="property_type_id", columns={"property_type_id"}),
 *      @ORM\Index(name="num_living_rooms", columns={"num_living_rooms"}),
 *      @ORM\Index(name="num_bathrooms", columns={"num_bathrooms"}),
 *      @ORM\Index(name="num_bedrooms", columns={"num_bedrooms"}),
 *      @ORM\Index(name="investment_score", columns={"investment_score"}),
 *      @ORM\Index(name="investment_score_accuracy", columns={"investment_score_accuracy"}),
 *      @ORM\Index(name="score_land_property", columns={"score_land_property"}),
 *      @ORM\Index(name="score_transport_infrastructure", columns={"score_transport_infrastructure"}),
 *      @ORM\Index(name="score_education_employement", columns={"score_education_employement"}),
 *      @ORM\Index(name="score_safety_comfort", columns={"score_safety_comfort"}),
 *      @ORM\Index(name="score_lifestyle_leisure", columns={"score_lifestyle_leisure"}),
 *      @ORM\Index(name="agent_id", columns={"agent_id"})
 * })
 */
class PropertyData
{

    /**
     * @ORM\Column(type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=10)
     */
    private $reference;

    /**
     * @ORM\Column(type="string", length=10)
     */
    private $listing_type;

    /**
     * @ORM\Column(type="string", length=15, nullable=true)
     */
    private $latitude;

    /**
     * @ORM\Column(type="string", length=15, nullable=true)
     */
    private $longitude;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    protected $status;

    /**
     * @ORM\Column(type="integer")
     */
    private $listing_status;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    private $freehold_length = 0;

    /**
     * @ORM\Column(type="json_array", nullable=true)
     */
    private $accepted_tennants;

    /**
     * @ORM\Column(type="string", length=100)
     */
    private $title;

    /**
     * @ORM\Column(type="string", length=100)
     */
    private $house_number;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    protected $display_address;

    /**
     * @ORM\Column(type="string", length=100)
     */
    private $address_line_1;

    /**
     * @ORM\Column(type="string", length=100, nullable=true)
     */
    private $address_line_2;

    /**
     * @ORM\Column(type="integer")
     */
    private $town_id;

    /**
     * @ORM\Column(type="integer")
     */
    private $county_id;

    /**
     * @ORM\Column(type="integer")
     */
    private $country_id;

    /**
     * @ORM\Column(type="integer")
     */
    private $postcode_id;

    /**
     * @ORM\Column(type="integer")
     */
    private $council_id;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $short_description;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $long_description;

    /**
     * @ORM\Column(type="integer")
     */
    private $size_sq_ft = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $property_type_id = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $floor_level = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $property_age = 0;

    /**
     * @ORM\Column(type="string", length=2)
     */
    private $tenure_type = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $garage = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $num_living_rooms = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $num_bathrooms = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $num_bedrooms = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $num_floors = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $num_receptions = 0;

    /**
     * @ORM\Column(type="integer")
     */
    protected $deposit_required = 0;

    /**
     * @ORM\Column(type="integer")
     */
    protected $deposit_required_amount = 0;

    /**
     * @ORM\Column(type="integer")
     */
    protected $min_offer_amount = 0;

    /**
     * @ORM\Column(type="integer")
     */
    protected $rent_advance = 0;

    /**
     * @ORM\Column(type="integer")
     */
    protected $rent_advance_amount = 0;

    /**
     * @ORM\Column(type="integer")
     */
    protected $rent_contract_length = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $region_id;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $key_features;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $main_image;

    /**
     * @ORM\Column(type="json_array", nullable=true)
     */
    private $images;

    /**
     * @ORM\Column(type="json_array", nullable=true)
     */
    private $floorplans;

    /**
     * @ORM\Column(type="text", nullable=true)
     */
    private $epc;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $date_available;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $max_advance_rental_date;

    /**
     * @ORM\Column(type="integer", nullable=true)
     */
    private $guarantor;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $sold_at;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $created_at;

    /**
     * @ORM\Column(type="datetime", nullable=true)
     */
    private $updated_at;

    /**
     * @ORM\ManyToOne(targetEntity="UtilTown", inversedBy="properties")
     * @ORM\JoinColumn(name="town_id", referencedColumnName="id")
     */
    private $town;

    /**
     * @ORM\ManyToOne(targetEntity="UtilCounty", inversedBy="properties")
     * @ORM\JoinColumn(name="county_id", referencedColumnName="id")
     */
    private $county;

    /**
     * @ORM\ManyToOne(targetEntity="UtilCountry", inversedBy="properties")
     * @ORM\JoinColumn(name="country_id", referencedColumnName="id")
     */
    private $country;

    /**
     * @ORM\ManyToOne(targetEntity="UtilCouncil", inversedBy="properties")
     * @ORM\JoinColumn(name="council_id", referencedColumnName="id")
     */
    private $council;

    /**
     * @ORM\ManyToOne(targetEntity="UtilRegions", inversedBy="property_data")
     * @ORM\JoinColumn(name="region_id", referencedColumnName="id")
     */
    private $region;

    /**
     * @ORM\ManyToOne(targetEntity="UtilPostcode", inversedBy="properties")
     * @ORM\JoinColumn(name="postcode_id", referencedColumnName="id")
     */
    private $postcode;

    /**
     * @ORM\ManyToOne(targetEntity="UtilPropertyType", inversedBy="properties")
     * @ORM\JoinColumn(name="property_type_id", referencedColumnName="id")
     */
    private $property_type;

    /**
     * @ORM\OneToMany(targetEntity="\Minos\Bundle\PropertyBundle\Entity\PropertyPrice", mappedBy="properties", cascade={"all"})
     */
    private $prices;

    public function __construct()
    {
        $this->updated_at = new \DateTime("now");
    }

    /**
     * Set status values
     *
     * @return integer
     */
    public static function getStatusList()
    {
        return array(
            '0' => 'Deleted',
            '1' => 'Listed',
            '2' => 'In-Active',
            '3' => 'Archive',
            '4' => 'Sold',
            '5' => 'Pending'
        );
    }

    public static function getListingTypes()
    {
        return array(
            'Sale' => 'Sale',
            'Let' => 'Let'
        );
    }

    public static function getListingStatusList()
    {
        return [
            '0' => "Available",
            '1' => "SSTC",
            '2' => "SSTCM",
            '3' => "Under Offer",
            '4' => "Reserved",
            '5' => "Let Agreed"
        ];
    }

    public static function getTenureTypes()
    {
        return array(
            1 => "Freehold",
            2 => "Leasehold",
            3 => "Feudal",
            4 => "Commonhold",
            5 => "Share of Freehold"
        );
    }

    public static function getTennantTypes()
    {
        return array(
            1 => "Housing benefits",
            2 => "Students",
            3 => "Sharers"
        );
    }

    public static function getRentalLengthValues()
    {
        return array(
            1 => "1 Month",
            2 => "2 Month",
            3 => "3 Months",
            4 => "4 Months",
            5 => "5 Months",
            6 => "6 Months",
            7 => "9 Months",
            8 => "12 Months",
            9 => "18 Months",
            10 => "24 Months"
        );
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set reference
     *
     * @param string $reference
     * @return PropertyData
     */
    public function setReference($reference)
    {
        $this->reference = $reference;

        return $this;
    }

    /**
     * Get reference
     *
     * @return string
     */
    public function getReference()
    {
        return $this->reference;
    }

    /**
     * Set listing_type
     *
     * @param string $listingType
     * @return PropertyData
     */
    public function setListingType($listingType)
    {
        $this->listing_type = $listingType;

        return $this;
    }

    /**
     * Get listing_type
     *
     * @return string
     */
    public function getListingType()
    {
        return $this->listing_type;
    }

    /**
     * Set latitude
     *
     * @param string $latitude
     * @return PropertyData
     */
    public function setLatitude($latitude)
    {
        $this->latitude = $latitude;

        return $this;
    }

    /**
     * Get latitude
     *
     * @return string
     */
    public function getLatitude()
    {
        return $this->latitude;
    }

    /**
     * Set longitude
     *
     * @param string $longitude
     * @return PropertyData
     */
    public function setLongitude($longitude)
    {
        $this->longitude = $longitude;

        return $this;
    }

    /**
     * Get longitude
     *
     * @return string
     */
    public function getLongitude()
    {
        return $this->longitude;
    }

    /**
     * Set listing_status
     *
     * @param integer $listingStatus
     * @return PropertyData
     */
    public function setListingStatus($listingStatus)
    {
        $this->listing_status = $listingStatus;

        if ($listingStatus == 4 && $this->getSoldAt() == '0000-00-00 00:00:00') {
            $this->setSoldAt(new \DateTime("now"));
        }

        return $this;
    }

    /**
     * Get listing_status
     *
     * @return integer
     */
    public function getListingStatus()
    {
        return $this->listing_status;
    }

    /**
     * Set title
     *
     * @param string $title
     * @return PropertyData
     */
    public function setTitle($title)
    {
        $this->title = $title;

        return $this;
    }

    /**
     * Get title
     *
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Set house_number
     *
     * @param string $houseNumber
     * @return PropertyData
     */
    public function setHouseNumber($houseNumber)
    {
        $this->house_number = $houseNumber;

        return $this;
    }

    /**
     * Get house_number
     *
     * @return string
     */
    public function getHouseNumber()
    {
        return $this->house_number;
    }

    /**
     * Set address_line_1
     *
     * @param string $addressLine1
     * @return PropertyData
     */
    public function setAddressLine1($addressLine1)
    {
        $this->address_line_1 = $addressLine1;

        return $this;
    }

    /**
     * Get address_line_1
     *
     * @return string
     */
    public function getAddressLine1()
    {
        return $this->address_line_1;
    }

    /**
     * Set address_line_2
     *
     * @param string $addressLine2
     * @return PropertyData
     */
    public function setAddressLine2($addressLine2)
    {
        $this->address_line_2 = $addressLine2;

        return $this;
    }

    /**
     * Get address_line_2
     *
     * @return string
     */
    public function getAddressLine2()
    {
        return $this->address_line_2;
    }

    /**
     * Set town_id
     *
     * @param integer $townId
     * @return PropertyData
     */
    public function setTownId($townId)
    {
        $this->town_id = $townId;

        return $this;
    }

    /**
     * Get town_id
     *
     * @return integer
     */
    public function getTownId()
    {
        return $this->town_id;
    }

    /**
     * Set county_id
     *
     * @param integer $countyId
     * @return PropertyData
     */
    public function setCountyId($countyId)
    {
        $this->county_id = $countyId;

        return $this;
    }

    /**
     * Get county_id
     *
     * @return integer
     */
    public function getCountyId()
    {
        return $this->county_id;
    }

    /**
     * Set country_id
     *
     * @param integer $countryId
     * @return PropertyData
     */
    public function setCountryId($countryId)
    {
        $this->country_id = $countryId;

        return $this;
    }

    /**
     * Get country_id
     *
     * @return integer
     */
    public function getCountryId()
    {
        return $this->country_id;
    }

    /**
     * Set postcode_id
     *
     * @param integer $postcodeId
     * @return PropertyData
     */
    public function setPostcodeId($postcodeId)
    {
        $this->postcode_id = $postcodeId;

        return $this;
    }

    /**
     * Get postcode_id
     *
     * @return integer
     */
    public function getPostcodeId()
    {
        return $this->postcode_id;
    }

    /**
     * Set council_id
     *
     * @param integer $councilId
     * @return PropertyData
     */
    public function setCouncilId($councilId)
    {
        $this->council_id = $councilId;

        return $this;
    }

    /**
     * Get council_id
     *
     * @return integer
     */
    public function getCouncilId()
    {
        return $this->council_id;
    }

    /**
     * Set short_description
     *
     * @param string $shortDescription
     * @return PropertyData
     */
    public function setShortDescription($shortDescription)
    {
        $this->short_description = $shortDescription;

        return $this;
    }

    /**
     * Get short_description
     *
     * @return string
     */
    public function getShortDescription()
    {
        return $this->short_description;
    }

    /**
     * Set long_description
     *
     * @param string $longDescription
     * @return PropertyData
     */
    public function setLongDescription($longDescription)
    {
        $this->long_description = $longDescription;

        return $this;
    }

    /**
     * Get long_description
     *
     * @return string
     */
    public function getLongDescription()
    {
        return $this->long_description;
    }

    /**
     * Set size_sq_ft
     *
     * @param integer $sizeSqFt
     * @return PropertyData
     */
    public function setSizeSqFt($sizeSqFt)
    {
        $this->size_sq_ft = $sizeSqFt;

        return $this;
    }

    /**
     * Get size_sq_ft
     *
     * @return integer
     */
    public function getSizeSqFt()
    {
        return $this->size_sq_ft;
    }

    /**
     * Set property_type_id
     *
     * @param integer $propertyTypeId
     * @return PropertyData
     */
    public function setPropertyTypeId($propertyTypeId)
    {
        $this->property_type_id = $propertyTypeId;

        return $this;
    }

    /**
     * Get property_type_id
     *
     * @return integer
     */
    public function getPropertyTypeId()
    {
        return $this->property_type_id;
    }

    /**
     * Set floor_level
     *
     * @param integer $floorLevel
     * @return PropertyData
     */
    public function setFloorLevel($floorLevel)
    {
        $this->floor_level = $floorLevel;

        return $this;
    }

    /**
     * Get floor_level
     *
     * @return integer
     */
    public function getFloorLevel()
    {
        return $this->floor_level;
    }

    /**
     * Set property_age
     *
     * @param integer $propertyAge
     * @return PropertyData
     */
    public function setPropertyAge($propertyAge)
    {
        $this->property_age = $propertyAge;

        return $this;
    }

    /**
     * Get property_age
     *
     * @return integer
     */
    public function getPropertyAge()
    {
        return $this->property_age;
    }

    /**
     * Set tenure_type
     *
     * @param string $tenureType
     * @return PropertyData
     */
    public function setTenureType($tenureType)
    {
        $this->tenure_type = $tenureType;

        return $this;
    }

    /**
     * Get tenure_type
     *
     * @return string
     */
    public function getTenureType()
    {
        return $this->tenure_type;
    }

    /**
     * Set garage
     *
     * @param integer $garage
     * @return PropertyData
     */
    public function setGarage($garage)
    {
        $this->garage = $garage;

        return $this;
    }

    /**
     * Get garage
     *
     * @return integer
     */
    public function getGarage()
    {
        return $this->garage;
    }

    /**
     * Set num_living_rooms
     *
     * @param integer $numLivingRooms
     * @return PropertyData
     */
    public function setNumLivingRooms($numLivingRooms)
    {
        $this->num_living_rooms = $numLivingRooms;

        return $this;
    }

    /**
     * Get num_living_rooms
     *
     * @return integer
     */
    public function getNumLivingRooms()
    {
        return $this->num_living_rooms;
    }

    /**
     * Set num_bathrooms
     *
     * @param integer $numBathrooms
     * @return PropertyData
     */
    public function setNumBathrooms($numBathrooms)
    {
        $this->num_bathrooms = $numBathrooms;

        return $this;
    }

    /**
     * Get num_bathrooms
     *
     * @return integer
     */
    public function getNumBathrooms()
    {
        return $this->num_bathrooms;
    }

    /**
     * Set num_bedrooms
     *
     * @param integer $numBedrooms
     * @return PropertyData
     */
    public function setNumBedrooms($numBedrooms)
    {
        $this->num_bedrooms = $numBedrooms;

        return $this;
    }

    /**
     * Get num_bedrooms
     *
     * @return integer
     */
    public function getNumBedrooms()
    {
        return $this->num_bedrooms;
    }

    /**
     * Set num_floors
     *
     * @param integer $numFloors
     * @return PropertyData
     */
    public function setNumFloors($numFloors)
    {
        $this->num_floors = $numFloors;

        return $this;
    }

    /**
     * Get num_floors
     *
     * @return integer
     */
    public function getNumFloors()
    {
        return $this->num_floors;
    }

    /**
     * Set num_receptions
     *
     * @param integer $numReceptions
     * @return PropertyData
     */
    public function setNumReceptions($numReceptions)
    {
        $this->num_receptions = $numReceptions;

        return $this;
    }

    /**
     * Get num_receptions
     *
     * @return integer
     */
    public function getNumReceptions()
    {
        return $this->num_receptions;
    }

    /**
     * Set region_id
     *
     * @param integer $regionId
     * @return PropertyData
     */
    public function setRegionId($regionId)
    {
        $this->region_id = $regionId;

        return $this;
    }

    /**
     * Get region_id
     *
     * @return integer
     */
    public function getRegionId()
    {
        return $this->region_id;
    }

    /**
     * Set created_at
     *
     * @param \DateTime $createdAt
     * @return PropertyData
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;

        return $this;
    }

    /**
     * Get created_at
     *
     * @return \DateTime
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * Set updated_at
     *
     * @param \DateTime $updatedAt
     * @return PropertyData
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updated_at = $updatedAt;

        return $this;
    }

    /**
     * Get updated_at
     *
     * @return \DateTime
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }

    /**
     * Set town
     *
     * @param \Minos\Bundle\PropertyBundle\Entity\UtilTown $town
     * @return PropertyData
     */
    public function setTown(\Minos\Bundle\PropertyBundle\Entity\UtilTown $town = null)
    {
        $this->town = $town;

        return $this;
    }

    /**
     * Get town
     *
     * @return \Minos\Bundle\PropertyBundle\Entity\UtilTown
     */
    public function getTown()
    {
        return $this->town;
    }

    /**
     * Set county
     *
     * @param \Minos\Bundle\PropertyBundle\Entity\UtilCounty $county
     * @return PropertyData
     */
    public function setCounty(\Minos\Bundle\PropertyBundle\Entity\UtilCounty $county = null)
    {
        $this->county = $county;

        return $this;
    }

    /**
     * Get county
     *
     * @return \Minos\Bundle\PropertyBundle\Entity\UtilCounty
     */
    public function getCounty()
    {
        return $this->county;
    }

    /**
     * Set country
     *
     * @param \Minos\Bundle\PropertyBundle\Entity\UtilCountry $country
     * @return PropertyData
     */
    public function setCountry(\Minos\Bundle\PropertyBundle\Entity\UtilCountry $country = null)
    {
        $this->country = $country;

        return $this;
    }

    /**
     * Get country
     *
     * @return \Minos\Bundle\PropertyBundle\Entity\UtilCountry
     */
    public function getCountry()
    {
        return $this->country;
    }

    /**
     * Set council
     *
     * @param \Minos\Bundle\PropertyBundle\Entity\UtilCouncil $council
     * @return PropertyData
     */
    public function setCouncil(\Minos\Bundle\PropertyBundle\Entity\UtilCouncil $council = null)
    {
        $this->council = $council;

        return $this;
    }

    /**
     * Get council
     *
     * @return \Minos\Bundle\PropertyBundle\Entity\UtilCouncil
     */
    public function getCouncil()
    {
        return $this->council;
    }

    /**
     * Set region
     *
     * @param \Minos\Bundle\PropertyBundle\Entity\UtilRegions $region
     * @return PropertyData
     */
    public function setRegion(\Minos\Bundle\PropertyBundle\Entity\UtilRegions $region = null)
    {
        $this->region = $region;

        return $this;
    }

    /**
     * Get region
     *
     * @return \Minos\Bundle\PropertyBundle\Entity\UtilRegions
     */
    public function getRegion()
    {
        return $this->region;
    }

    /**
     * Set postcode
     *
     * @param \Minos\Bundle\PropertyBundle\Entity\UtilPostcode $postcode
     * @return PropertyData
     */
    public function setPostcode(\Minos\Bundle\PropertyBundle\Entity\UtilPostcode $postcode = null)
    {
        $this->postcode = $postcode;

        return $this;
    }

    /**
     * Get postcode
     *
     * @return \Minos\Bundle\PropertyBundle\Entity\UtilPostcode
     */
    public function getPostcode()
    {
        return $this->postcode;
    }

    /**
     * Set property_type
     *
     * @param \Minos\Bundle\PropertyBundle\Entity\UtilPropertyType $propertyType
     * @return PropertyData
     */
    public function setPropertyType(\Minos\Bundle\PropertyBundle\Entity\UtilPropertyType $propertyType = null)
    {
        $this->property_type = $propertyType;

        return $this;
    }

    /**
     * Get property_type
     *
     * @return \Minos\Bundle\PropertyBundle\Entity\UtilPropertyType
     */
    public function getPropertyType()
    {
        return $this->property_type;
    }

    /**
     * Add prices
     *
     * @param \Minos\Bundle\PropertyBundle\Entity\PropertyPrice $prices
     * @return PropertyData
     */
    public function addPrice(\Minos\Bundle\PropertyBundle\Entity\PropertyPrice $prices)
    {
        $this->prices[] = $prices;

        return $this;
    }

    /**
     * Remove prices
     *
     * @param \Minos\Bundle\PropertyBundle\Entity\PropertyPrice $prices
     */
    public function removePrice(\Minos\Bundle\PropertyBundle\Entity\PropertyPrice $prices)
    {
        $this->prices->removeElement($prices);
    }

    /**
     * Get prices
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPrices()
    {
        return $this->prices;
    }

    /**
     * Set status
     *
     * @param integer $status
     * @return PropertyData
     */
    public function setStatus($status)
    {
        $this->status = $status;

        return $this;
    }

    /**
     * Get status
     *
     * @return integer
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * Set display_address
     *
     * @param string $displayAddress
     * @return PropertyData
     */
    public function setDisplayAddress($displayAddress)
    {
        $this->display_address = $displayAddress;

        return $this;
    }

    /**
     * Get display_address
     *
     * @return string
     */
    public function getDisplayAddress()
    {
        return $this->display_address;
    }

    /**
     * Set deposit_required
     *
     * @param integer $depositRequired
     * @return PropertyData
     */
    public function setDepositRequired($depositRequired)
    {
        $this->deposit_required = $depositRequired;

        return $this;
    }

    /**
     * Get deposit_required
     *
     * @return integer
     */
    public function getDepositRequired()
    {
        return $this->deposit_required;
    }

    /**
     * Set deposit_required_amount
     *
     * @param integer $depositRequiredAmount
     * @return PropertyData
     */
    public function setDepositRequiredAmount($depositRequiredAmount)
    {
        $this->deposit_required_amount = $depositRequiredAmount;

        return $this;
    }

    /**
     * Get deposit_required_amount
     *
     * @return integer
     */
    public function getDepositRequiredAmount()
    {
        return $this->deposit_required_amount;
    }

    /**
     * Set rent_advance
     *
     * @param integer $rentAdvance
     * @return PropertyData
     */
    public function setRentAdvance($rentAdvance)
    {
        $this->rent_advance = $rentAdvance;

        return $this;
    }

    /**
     * Get rent_advance
     *
     * @return integer
     */
    public function getRentAdvance()
    {
        return $this->rent_advance;
    }

    /**
     * Set rent_advance_amount
     *
     * @param integer $rentAdvanceAmount
     * @return PropertyData
     */
    public function setRentAdvanceAmount($rentAdvanceAmount)
    {
        $this->rent_advance_amount = $rentAdvanceAmount;

        return $this;
    }

    /**
     * Get rent_advance_amount
     *
     * @return integer
     */
    public function getRentAdvanceAmount()
    {
        return $this->rent_advance_amount;
    }

    /**
     * Set rent_contract_length
     *
     * @param integer $rentContractLength
     * @return PropertyData
     */
    public function setRentContractLength($rentContractLength)
    {
        $this->rent_contract_length = $rentContractLength;

        return $this;
    }

    /**
     * Get rent_contract_length
     *
     * @return integer
     */
    public function getRentContractLength()
    {
        return $this->rent_contract_length;
    }

    /**
     * Set main_image
     *
     * @param string $mainImage
     * @return PropertyData
     */
    public function setMainImage($mainImage)
    {
        $this->main_image = $mainImage;

        return $this;
    }

    /**
     * Get main_image
     *
     * @return string
     */
    public function getMainImage()
    {
        return $this->main_image;
    }

    /**
     * Set images
     *
     * @param array $images
     * @return PropertyData
     */
    public function setImages($images)
    {
        $this->images = $images;

        return $this;
    }

    /**
     * Get images
     *
     * @return array
     */
    public function getImages()
    {
        return $this->images;
    }

    /**
     * Set key_features
     *
     * @param string $keyFeatures
     * @return PropertyData
     */
    public function setKeyFeatures($keyFeatures)
    {
        $this->key_features = $keyFeatures;

        return $this;
    }

    /**
     * Get key_features
     *
     * @return string
     */
    public function getKeyFeatures()
    {
        return $this->key_features;
    }

    /**
     * Set floorplans
     *
     * @param array $floorplans
     * @return PropertyData
     */
    public function setFloorplans($floorplans)
    {
        $this->floorplans = $floorplans;

        return $this;
    }

    /**
     * Get floorplans
     *
     * @return array
     */
    public function getFloorplans()
    {
        return $this->floorplans;
    }

    /**
     * Set epc
     *
     * @param string $epc
     * @return PropertyData
     */
    public function setEpc($epc)
    {
        $this->epc = $epc;

        return $this;
    }

    /**
     * Get epc
     *
     * @return string
     */
    public function getEpc()
    {
        return $this->epc;
    }

    /**
     * Set sold_at
     *
     * @param \DateTime $soldAt
     * @return PropertyData
     */
    public function setSoldAt($soldAt)
    {
        $this->sold_at = $soldAt;

        return $this;
    }

    /**
     * Get sold_at
     *
     * @return \DateTime
     */
    public function getSoldAt()
    {
        return $this->sold_at;
    }

    /**
     * Set freehold_length
     *
     * @param integer $freeholdLength
     * @return PropertyData
     */
    public function setFreeholdLength($freeholdLength)
    {
        $this->freehold_length = $freeholdLength;

        return $this;
    }

    /**
     * Get freehold_length
     *
     * @return integer
     */
    public function getFreeholdLength()
    {
        return $this->freehold_length;
    }

    /**
     * Set accepted_tennants
     *
     * @param array $acceptedTennants
     * @return PropertyData
     */
    public function setAcceptedTennants($acceptedTennants)
    {
        $this->accepted_tennants = $acceptedTennants;

        return $this;
    }

    /**
     * Get accepted_tennants
     *
     * @return array
     */
    public function getAcceptedTennants()
    {
        return $this->accepted_tennants;
    }

    /**
     * Set min_offer_amount
     *
     * @param integer $minOfferAmount
     * @return PropertyData
     */
    public function setMinOfferAmount($minOfferAmount)
    {
        $this->min_offer_amount = $minOfferAmount;

        return $this;
    }

    /**
     * Get min_offer_amount
     *
     * @return integer
     */
    public function getMinOfferAmount()
    {
        return $this->min_offer_amount;
    }

    /**
     * Set date_available
     *
     * @param \DateTime $dateAvailable
     * @return PropertyData
     */
    public function setDateAvailable($dateAvailable)
    {
        $this->date_available = $dateAvailable;

        return $this;
    }

    /**
     * Get date_available
     *
     * @return \DateTime
     */
    public function getDateAvailable()
    {
        return $this->date_available;
    }

    /**
     * Set max_advance_rental_date
     *
     * @param \DateTime $maxAdvanceRentalDate
     * @return PropertyData
     */
    public function setMaxAdvanceRentalDate($maxAdvanceRentalDate)
    {
        $this->max_advance_rental_date = $maxAdvanceRentalDate;

        return $this;
    }

    /**
     * Get max_advance_rental_date
     *
     * @return \DateTime
     */
    public function getMaxAdvanceRentalDate()
    {
        return $this->max_advance_rental_date;
    }

    /**
     * Set guarantor
     *
     * @param integer $guarantor
     * @return PropertyData
     */
    public function setGuarantor($guarantor)
    {
        $this->guarantor = $guarantor;

        return $this;
    }

    /**
     * Get guarantor
     *
     * @return integer
     */
    public function getGuarantor()
    {
        return $this->guarantor;
    }
}

And this is the one that extends it:

<?php

namespace Howsmart\Bundle\PropertyBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use json_array;
use Minos\Bundle\PropertyBundle\Entity\PropertyData;

/**
 * Property
 *
 * @ORM\Entity(repositoryClass="Howsmart\Bundle\PropertyBundle\Entity\PropertyRepository")
 *
 */
class Property extends PropertyData
{
    /**
     * @ORM\Column(type="integer")
     */
    protected $flag_yield = 0;

    /**
     * @ORM\Column(type="decimal", scale=2)
     */
    protected $yield = 0.00;

    /**
     * @ORM\ManyToOne(targetEntity="\Howsmart\Bundle\AgentBundle\Entity\Agent", inversedBy="properties")
     * @ORM\JoinColumn(name="agent_id", referencedColumnName="id")
     */
    protected $agent;

    /**
     * @ORM\Column(type="integer")
     */
    private $investment_score_accuracy = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $investment_score = 0;

    /**
     * @ORM\Column(type="json_array")
     */
    private $investment_calculations;

    /**
     * @ORM\Column(type="integer")
     */
    private $flag_valuation = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $flag_score = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $flag_price_paid = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $agent_id = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $score_land_property = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $score_transport_infrastructure = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $score_education_employement = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $score_safety_comfort = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $score_lifestyle_leisure = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $soft_views_today = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $views_today = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $soft_views_yesterday = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $views_yesterday = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $soft_views_weekly = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $views_weekly = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $soft_views_total = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $views_total = 0;

    /**
     * @ORM\Column(type="integer", nullable=false, options={"default": 0})
     */
    private $enquiries_today = 0;

    /**
     * @ORM\Column(type="integer", nullable=false, options={"default": 0})
     */
    private $enquiries_yesterday = 0;

    /**
     * @ORM\Column(type="integer", nullable=false, options={"default": 0})
     */
    private $enquiries_weekly = 0;

    /**
     * @ORM\Column(type="integer", nullable=false, options={"default": 0})
     */
    private $enquiries_total = 0;

    /**
     * @ORM\Column(type="integer")
     */
    private $flag_growth = 0;

    /**
     * @ORM\Column(type="decimal", scale=2)
     */
    private $growth = 0.00;

    /**
     * @ORM\OneToMany(targetEntity="\Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid", mappedBy="postcode")
     */
    protected $data_price_paid;

    public function getListingPrice()
    {
        foreach ($this->getPrices() as $price) {
            if ($price->getPropertyStatus() == 1) {
                return $price->getPrice();
            }
        }
    }

    public function getValuation()
    {
        foreach ($this->getPrices() as $price) {
            if ($price->getPropertyStatus() == 3 && $price->getPropertyType() == "sale") {
                return $price->getPrice();
            }
        }
    }

    public function getRecommendedRental()
    {
        foreach ($this->getPrices() as $price) {
            if ($price->getPropertyStatus() == 3 && $price->getPropertyType() == "rent") {
                return $price->getPrice();
            }
        }
    }

    /**
     * Set investment_score
     *
     * @param integer $investmentScore
     * @return Property
     */
    public function setInvestmentScore($investmentScore)
    {
        $this->investment_score = $investmentScore;

        return $this;
    }

    /**
     * Get investment_score
     *
     * @return integer
     */
    public function getInvestmentScore()
    {
        return $this->investment_score;
    }

    /**
     * Set investment_calculations
     *
     * @param array $investmentCalculations
     * @return Property
     */
    public function setInvestmentCalculations($investmentCalculations)
    {
        $this->investment_calculations = $investmentCalculations;

        return $this;
    }

    /**
     * Get investment_calculations
     *
     * @return array
     */
    public function getInvestmentCalculations()
    {
        return $this->investment_calculations;
    }

    /**
     * Set flag_valuation
     *
     * @param integer $flagValuation
     * @return Property
     */
    public function setFlagValuation($flagValuation)
    {
        $this->flag_valuation = $flagValuation;

        return $this;
    }

    /**
     * Get flag_valuation
     *
     * @return integer
     */
    public function getFlagValuation()
    {
        return $this->flag_valuation;
    }

    /**
     * Set flag_score
     *
     * @param integer $flagScore
     * @return Property
     */
    public function setFlagScore($flagScore)
    {
        $this->flag_score = $flagScore;

        return $this;
    }

    /**
     * Get flag_score
     *
     * @return integer
     */
    public function getFlagScore()
    {
        return $this->flag_score;
    }

    /**
     * Set flag_price_paid
     *
     * @param integer $flagPricePaid
     * @return Property
     */
    public function setFlagPricePaid($flagPricePaid)
    {
        $this->flag_price_paid = $flagPricePaid;

        return $this;
    }

    /**
     * Get flag_price_paid
     *
     * @return integer
     */
    public function getFlagPricePaid()
    {
        return $this->flag_price_paid;
    }

    /**
     * Set investment_score_accuracy
     *
     * @param integer $investmentScoreAccuracy
     * @return Property
     */
    public function setInvestmentScoreAccuracy($investmentScoreAccuracy)
    {
        $this->investment_score_accuracy = $investmentScoreAccuracy;

        return $this;
    }

    /**
     * Get investment_score_accuracy
     *
     * @return integer
     */
    public function getInvestmentScoreAccuracy()
    {
        return $this->investment_score_accuracy;
    }

    /**
     * Set score_land_property
     *
     * @param integer $scoreLandProperty
     * @return Property
     */
    public function setScoreLandProperty($scoreLandProperty)
    {
        $this->score_land_property = $scoreLandProperty;

        return $this;
    }

    /**
     * Get score_land_property
     *
     * @return integer
     */
    public function getScoreLandProperty()
    {
        return $this->score_land_property;
    }

    /**
     * Set score_transport_infrastructure
     *
     * @param integer $scoreTransportInfrastructure
     * @return Property
     */
    public function setScoreTransportInfrastructure($scoreTransportInfrastructure)
    {
        $this->score_transport_infrastructure = $scoreTransportInfrastructure;

        return $this;
    }

    /**
     * Get score_transport_infrastructure
     *
     * @return integer
     */
    public function getScoreTransportInfrastructure()
    {
        return $this->score_transport_infrastructure;
    }

    /**
     * Set score_education_employement
     *
     * @param integer $scoreEducationEmployement
     * @return Property
     */
    public function setScoreEducationEmployement($scoreEducationEmployement)
    {
        $this->score_education_employement = $scoreEducationEmployement;

        return $this;
    }

    /**
     * Get score_education_employement
     *
     * @return integer
     */
    public function getScoreEducationEmployement()
    {
        return $this->score_education_employement;
    }

    /**
     * Set score_safety_comfort
     *
     * @param integer $scoreSafetyComfort
     * @return Property
     */
    public function setScoreSafetyComfort($scoreSafetyComfort)
    {
        $this->score_safety_comfort = $scoreSafetyComfort;

        return $this;
    }

    /**
     * Get score_safety_comfort
     *
     * @return integer
     */
    public function getScoreSafetyComfort()
    {
        return $this->score_safety_comfort;
    }

    /**
     * Set score_lifestyle_leisure
     *
     * @param integer $scoreLifestyleLeisure
     * @return Property
     */
    public function setScoreLifestyleLeisure($scoreLifestyleLeisure)
    {
        $this->score_lifestyle_leisure = $scoreLifestyleLeisure;

        return $this;
    }

    /**
     * Get score_lifestyle_leisure
     *
     * @return integer
     */
    public function getScoreLifestyleLeisure()
    {
        return $this->score_lifestyle_leisure;
    }

    /**
     * Get data_price_paid
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getDataPricePaid()
    {
        return $this->data_price_paid;
    }

    /**
     * Set soft_views
     *
     * @param integer $softViews
     * @return Property
     */
    public function setSoftViews($softViews)
    {
        $this->soft_views = $softViews;

        return $this;
    }

    /**
     * Get soft_views
     *
     * @return integer
     */
    public function getSoftViews()
    {
        return $this->soft_views;
    }

    /**
     * Set views
     *
     * @param integer $views
     * @return Property
     */
    public function setViews($views)
    {
        $this->views = $views;

        return $this;
    }

    /**
     * Get views
     *
     * @return integer
     */
    public function getViews()
    {
        return $this->views;
    }

    /**
     * Set agent
     *
     * @param \Howsmart\Bundle\AgentBundle\Entity\Agent $agent
     * @return Property
     */
    public function setAgent(\Howsmart\Bundle\AgentBundle\Entity\Agent $agent = null)
    {
        $this->agent = $agent;

        return $this;
    }

    /**
     * Get agent
     *
     * @return \Howsmart\Bundle\AgentBundle\Entity\Agent
     */
    public function getAgent()
    {
        return $this->agent;
    }

    /**
     * Set flag_yield
     *
     * @param integer $flagYield
     * @return Property
     */
    public function setFlagYield($flagYield)
    {
        $this->flag_yield = $flagYield;

        return $this;
    }

    /**
     * Get flag_yield
     *
     * @return integer
     */
    public function getFlagYield()
    {
        return $this->flag_yield;
    }

    /**
     * Set yield
     *
     * @param string $yield
     * @return Property
     */
    public function setYield($yield)
    {
        $this->yield = $yield;

        return $this;
    }

    /**
     * Get yield
     *
     * @return string
     */
    public function getYield()
    {
        return $this->yield;
    }

    /**
     * Set soft_views_today
     *
     * @param integer $softViewsToday
     * @return Property
     */
    public function setSoftViewsToday($softViewsToday)
    {
        $this->soft_views_today = $softViewsToday;

        return $this;
    }

    /**
     * Get soft_views_today
     *
     * @return integer
     */
    public function getSoftViewsToday()
    {
        return $this->soft_views_today;
    }

    /**
     * Set views_today
     *
     * @param integer $viewsToday
     * @return Property
     */
    public function setViewsToday($viewsToday)
    {
        $this->views_today = $viewsToday;

        return $this;
    }

    /**
     * Get views_today
     *
     * @return integer
     */
    public function getViewsToday()
    {
        return $this->views_today;
    }

    /**
     * Set soft_views_yesterday
     *
     * @param integer $softViewsYesterday
     * @return Property
     */
    public function setSoftViewsYesterday($softViewsYesterday)
    {
        $this->soft_views_yesterday = $softViewsYesterday;

        return $this;
    }

    /**
     * Get soft_views_yesterday
     *
     * @return integer
     */
    public function getSoftViewsYesterday()
    {
        return $this->soft_views_yesterday;
    }

    /**
     * Set views_yesterday
     *
     * @param integer $viewsYesterday
     * @return Property
     */
    public function setViewsYesterday($viewsYesterday)
    {
        $this->views_yesterday = $viewsYesterday;

        return $this;
    }

    /**
     * Get views_yesterday
     *
     * @return integer
     */
    public function getViewsYesterday()
    {
        return $this->views_yesterday;
    }

    /**
     * Set soft_views_weekly
     *
     * @param integer $softViewsWeekly
     * @return Property
     */
    public function setSoftViewsWeekly($softViewsWeekly)
    {
        $this->soft_views_weekly = $softViewsWeekly;

        return $this;
    }

    /**
     * Get soft_views_weekly
     *
     * @return integer
     */
    public function getSoftViewsWeekly()
    {
        return $this->soft_views_weekly;
    }

    /**
     * Set views_weekly
     *
     * @param integer $viewsWeekly
     * @return Property
     */
    public function setViewsWeekly($viewsWeekly)
    {
        $this->views_weekly = $viewsWeekly;

        return $this;
    }

    /**
     * Get views_weekly
     *
     * @return integer
     */
    public function getViewsWeekly()
    {
        return $this->views_weekly;
    }

    /**
     * Set soft_views_total
     *
     * @param integer $softViewsTotal
     * @return Property
     */
    public function setSoftViewsTotal($softViewsTotal)
    {
        $this->soft_views_total = $softViewsTotal;

        return $this;
    }

    /**
     * Get soft_views_total
     *
     * @return integer
     */
    public function getSoftViewsTotal()
    {
        return $this->soft_views_total;
    }

    /**
     * Set views_total
     *
     * @param integer $viewsTotal
     * @return Property
     */
    public function setViewsTotal($viewsTotal)
    {
        $this->views_total = $viewsTotal;

        return $this;
    }

    /**
     * Get views_total
     *
     * @return integer
     */
    public function getViewsTotal()
    {
        return $this->views_total;
    }

    /**
     * Add data_price_paid
     *
     * @param \Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid $dataPricePaid
     * @return Property
     */
    public function addDataPricePaid(\Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid $dataPricePaid)
    {
        $this->data_price_paid[] = $dataPricePaid;

        return $this;
    }

    /**
     * Remove data_price_paid
     *
     * @param \Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid $dataPricePaid
     */
    public function removeDataPricePaid(\Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid $dataPricePaid)
    {
        $this->data_price_paid->removeElement($dataPricePaid);
    }

    /**
     * Set flag_growth
     *
     * @param integer $flagGrowth
     * @return Property
     */
    public function setFlagGrowth($flagGrowth)
    {
        $this->flag_growth = $flagGrowth;

        return $this;
    }

    /**
     * Get flag_growth
     *
     * @return integer
     */
    public function getFlagGrowth()
    {
        return $this->flag_growth;
    }

    /**
     * Set growth
     *
     * @param string $growth
     * @return Property
     */
    public function setGrowth($growth)
    {
        $this->growth = $growth;

        return $this;
    }

    /**
     * Get growth
     *
     * @return string
     */
    public function getGrowth()
    {
        return $this->growth;
    }

    /**
     * Set enquiries_today
     *
     * @param integer $enquiriesToday
     * @return Property
     */
    public function setEnquiriesToday($enquiriesToday)
    {
        $this->enquiries_today = $enquiriesToday;

        return $this;
    }

    /**
     * Get enquiries_today
     *
     * @return integer
     */
    public function getEnquiriesToday()
    {
        return $this->enquiries_today;
    }

    /**
     * Set enquiries_yesterday
     *
     * @param integer $enquiriesYesterday
     * @return Property
     */
    public function setEnquiriesYesterday($enquiriesYesterday)
    {
        $this->enquiries_yesterday = $enquiriesYesterday;

        return $this;
    }

    /**
     * Get enquiries_yesterday
     *
     * @return integer
     */
    public function getEnquiriesYesterday()
    {
        return $this->enquiries_yesterday;
    }

    /**
     * Set enquiries_weekly
     *
     * @param integer $enquiriesWeekly
     * @return Property
     */
    public function setEnquiriesWeekly($enquiriesWeekly)
    {
        $this->enquiries_weekly = $enquiriesWeekly;

        return $this;
    }

    /**
     * Get enquiries_weekly
     *
     * @return integer
     */
    public function getEnquiriesWeekly()
    {
        return $this->enquiries_weekly;
    }

    /**
     * Set enquiries_total
     *
     * @param integer $enquiriesTotal
     * @return Property
     */
    public function setEnquiriesTotal($enquiriesTotal)
    {
        $this->enquiries_total = $enquiriesTotal;

        return $this;
    }

    /**
     * Get enquiries_total
     *
     * @return integer
     */
    public function getEnquiriesTotal()
    {
        return $this->enquiries_total;
    }

    /**
     * Set agent_id
     *
     * @param integer $agentId
     * @return Property
     */
    public function setAgentId($agentId)
    {
        $this->agent_id = $agentId;

        return $this;
    }

    /**
     * Get agent_id
     *
     * @return integer
     */
    public function getAgentId()
    {
        return $this->agent_id;
    }
}

The base entity is in a package and then the extended one is in the website bundle - just to clear up the name space differences 👍

Thanks!!

@ghost commented on GitHub (Dec 15, 2015): Here are the two entities This is the base one: ``` php <?php namespace Minos\Bundle\PropertyBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping\InheritanceType; use Doctrine\ORM\Mapping\JoinTable; /** * @ORM\Entity * @InheritanceType("SINGLE_TABLE") * * @ORM\HasLifecycleCallbacks * * @ORM\Table(name="property_data", indexes={ * @ORM\Index(name="listing_status", columns={"listing_status"}), * @ORM\Index(name="reference", columns={"reference"}), * @ORM\Index(name="listing_type", columns={"listing_type"}), * @ORM\Index(name="status", columns={"status"}), * @ORM\Index(name="council_id", columns={"council_id"}), * @ORM\Index(name="county_id", columns={"county_id"}), * @ORM\Index(name="town_id", columns={"town_id"}), * @ORM\Index(name="region_id", columns={"region_id"}), * @ORM\Index(name="postcode_id", columns={"postcode_id"}), * @ORM\Index(name="property_type_id", columns={"property_type_id"}), * @ORM\Index(name="num_living_rooms", columns={"num_living_rooms"}), * @ORM\Index(name="num_bathrooms", columns={"num_bathrooms"}), * @ORM\Index(name="num_bedrooms", columns={"num_bedrooms"}), * @ORM\Index(name="investment_score", columns={"investment_score"}), * @ORM\Index(name="investment_score_accuracy", columns={"investment_score_accuracy"}), * @ORM\Index(name="score_land_property", columns={"score_land_property"}), * @ORM\Index(name="score_transport_infrastructure", columns={"score_transport_infrastructure"}), * @ORM\Index(name="score_education_employement", columns={"score_education_employement"}), * @ORM\Index(name="score_safety_comfort", columns={"score_safety_comfort"}), * @ORM\Index(name="score_lifestyle_leisure", columns={"score_lifestyle_leisure"}), * @ORM\Index(name="agent_id", columns={"agent_id"}) * }) */ class PropertyData { /** * @ORM\Column(type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @ORM\Column(type="string", length=10) */ private $reference; /** * @ORM\Column(type="string", length=10) */ private $listing_type; /** * @ORM\Column(type="string", length=15, nullable=true) */ private $latitude; /** * @ORM\Column(type="string", length=15, nullable=true) */ private $longitude; /** * @ORM\Column(type="integer", nullable=true) */ protected $status; /** * @ORM\Column(type="integer") */ private $listing_status; /** * @ORM\Column(type="integer", nullable=true) */ private $freehold_length = 0; /** * @ORM\Column(type="json_array", nullable=true) */ private $accepted_tennants; /** * @ORM\Column(type="string", length=100) */ private $title; /** * @ORM\Column(type="string", length=100) */ private $house_number; /** * @ORM\Column(type="string", length=255, nullable=true) */ protected $display_address; /** * @ORM\Column(type="string", length=100) */ private $address_line_1; /** * @ORM\Column(type="string", length=100, nullable=true) */ private $address_line_2; /** * @ORM\Column(type="integer") */ private $town_id; /** * @ORM\Column(type="integer") */ private $county_id; /** * @ORM\Column(type="integer") */ private $country_id; /** * @ORM\Column(type="integer") */ private $postcode_id; /** * @ORM\Column(type="integer") */ private $council_id; /** * @ORM\Column(type="string", length=255, nullable=true) */ private $short_description; /** * @ORM\Column(type="text", nullable=true) */ private $long_description; /** * @ORM\Column(type="integer") */ private $size_sq_ft = 0; /** * @ORM\Column(type="integer") */ private $property_type_id = 0; /** * @ORM\Column(type="integer") */ private $floor_level = 0; /** * @ORM\Column(type="integer") */ private $property_age = 0; /** * @ORM\Column(type="string", length=2) */ private $tenure_type = 0; /** * @ORM\Column(type="integer") */ private $garage = 0; /** * @ORM\Column(type="integer") */ private $num_living_rooms = 0; /** * @ORM\Column(type="integer") */ private $num_bathrooms = 0; /** * @ORM\Column(type="integer") */ private $num_bedrooms = 0; /** * @ORM\Column(type="integer") */ private $num_floors = 0; /** * @ORM\Column(type="integer") */ private $num_receptions = 0; /** * @ORM\Column(type="integer") */ protected $deposit_required = 0; /** * @ORM\Column(type="integer") */ protected $deposit_required_amount = 0; /** * @ORM\Column(type="integer") */ protected $min_offer_amount = 0; /** * @ORM\Column(type="integer") */ protected $rent_advance = 0; /** * @ORM\Column(type="integer") */ protected $rent_advance_amount = 0; /** * @ORM\Column(type="integer") */ protected $rent_contract_length = 0; /** * @ORM\Column(type="integer") */ private $region_id; /** * @ORM\Column(type="text", nullable=true) */ private $key_features; /** * @ORM\Column(type="text", nullable=true) */ private $main_image; /** * @ORM\Column(type="json_array", nullable=true) */ private $images; /** * @ORM\Column(type="json_array", nullable=true) */ private $floorplans; /** * @ORM\Column(type="text", nullable=true) */ private $epc; /** * @ORM\Column(type="datetime", nullable=true) */ private $date_available; /** * @ORM\Column(type="datetime", nullable=true) */ private $max_advance_rental_date; /** * @ORM\Column(type="integer", nullable=true) */ private $guarantor; /** * @ORM\Column(type="datetime", nullable=true) */ private $sold_at; /** * @ORM\Column(type="datetime", nullable=true) */ private $created_at; /** * @ORM\Column(type="datetime", nullable=true) */ private $updated_at; /** * @ORM\ManyToOne(targetEntity="UtilTown", inversedBy="properties") * @ORM\JoinColumn(name="town_id", referencedColumnName="id") */ private $town; /** * @ORM\ManyToOne(targetEntity="UtilCounty", inversedBy="properties") * @ORM\JoinColumn(name="county_id", referencedColumnName="id") */ private $county; /** * @ORM\ManyToOne(targetEntity="UtilCountry", inversedBy="properties") * @ORM\JoinColumn(name="country_id", referencedColumnName="id") */ private $country; /** * @ORM\ManyToOne(targetEntity="UtilCouncil", inversedBy="properties") * @ORM\JoinColumn(name="council_id", referencedColumnName="id") */ private $council; /** * @ORM\ManyToOne(targetEntity="UtilRegions", inversedBy="property_data") * @ORM\JoinColumn(name="region_id", referencedColumnName="id") */ private $region; /** * @ORM\ManyToOne(targetEntity="UtilPostcode", inversedBy="properties") * @ORM\JoinColumn(name="postcode_id", referencedColumnName="id") */ private $postcode; /** * @ORM\ManyToOne(targetEntity="UtilPropertyType", inversedBy="properties") * @ORM\JoinColumn(name="property_type_id", referencedColumnName="id") */ private $property_type; /** * @ORM\OneToMany(targetEntity="\Minos\Bundle\PropertyBundle\Entity\PropertyPrice", mappedBy="properties", cascade={"all"}) */ private $prices; public function __construct() { $this->updated_at = new \DateTime("now"); } /** * Set status values * * @return integer */ public static function getStatusList() { return array( '0' => 'Deleted', '1' => 'Listed', '2' => 'In-Active', '3' => 'Archive', '4' => 'Sold', '5' => 'Pending' ); } public static function getListingTypes() { return array( 'Sale' => 'Sale', 'Let' => 'Let' ); } public static function getListingStatusList() { return [ '0' => "Available", '1' => "SSTC", '2' => "SSTCM", '3' => "Under Offer", '4' => "Reserved", '5' => "Let Agreed" ]; } public static function getTenureTypes() { return array( 1 => "Freehold", 2 => "Leasehold", 3 => "Feudal", 4 => "Commonhold", 5 => "Share of Freehold" ); } public static function getTennantTypes() { return array( 1 => "Housing benefits", 2 => "Students", 3 => "Sharers" ); } public static function getRentalLengthValues() { return array( 1 => "1 Month", 2 => "2 Month", 3 => "3 Months", 4 => "4 Months", 5 => "5 Months", 6 => "6 Months", 7 => "9 Months", 8 => "12 Months", 9 => "18 Months", 10 => "24 Months" ); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set reference * * @param string $reference * @return PropertyData */ public function setReference($reference) { $this->reference = $reference; return $this; } /** * Get reference * * @return string */ public function getReference() { return $this->reference; } /** * Set listing_type * * @param string $listingType * @return PropertyData */ public function setListingType($listingType) { $this->listing_type = $listingType; return $this; } /** * Get listing_type * * @return string */ public function getListingType() { return $this->listing_type; } /** * Set latitude * * @param string $latitude * @return PropertyData */ public function setLatitude($latitude) { $this->latitude = $latitude; return $this; } /** * Get latitude * * @return string */ public function getLatitude() { return $this->latitude; } /** * Set longitude * * @param string $longitude * @return PropertyData */ public function setLongitude($longitude) { $this->longitude = $longitude; return $this; } /** * Get longitude * * @return string */ public function getLongitude() { return $this->longitude; } /** * Set listing_status * * @param integer $listingStatus * @return PropertyData */ public function setListingStatus($listingStatus) { $this->listing_status = $listingStatus; if ($listingStatus == 4 && $this->getSoldAt() == '0000-00-00 00:00:00') { $this->setSoldAt(new \DateTime("now")); } return $this; } /** * Get listing_status * * @return integer */ public function getListingStatus() { return $this->listing_status; } /** * Set title * * @param string $title * @return PropertyData */ public function setTitle($title) { $this->title = $title; return $this; } /** * Get title * * @return string */ public function getTitle() { return $this->title; } /** * Set house_number * * @param string $houseNumber * @return PropertyData */ public function setHouseNumber($houseNumber) { $this->house_number = $houseNumber; return $this; } /** * Get house_number * * @return string */ public function getHouseNumber() { return $this->house_number; } /** * Set address_line_1 * * @param string $addressLine1 * @return PropertyData */ public function setAddressLine1($addressLine1) { $this->address_line_1 = $addressLine1; return $this; } /** * Get address_line_1 * * @return string */ public function getAddressLine1() { return $this->address_line_1; } /** * Set address_line_2 * * @param string $addressLine2 * @return PropertyData */ public function setAddressLine2($addressLine2) { $this->address_line_2 = $addressLine2; return $this; } /** * Get address_line_2 * * @return string */ public function getAddressLine2() { return $this->address_line_2; } /** * Set town_id * * @param integer $townId * @return PropertyData */ public function setTownId($townId) { $this->town_id = $townId; return $this; } /** * Get town_id * * @return integer */ public function getTownId() { return $this->town_id; } /** * Set county_id * * @param integer $countyId * @return PropertyData */ public function setCountyId($countyId) { $this->county_id = $countyId; return $this; } /** * Get county_id * * @return integer */ public function getCountyId() { return $this->county_id; } /** * Set country_id * * @param integer $countryId * @return PropertyData */ public function setCountryId($countryId) { $this->country_id = $countryId; return $this; } /** * Get country_id * * @return integer */ public function getCountryId() { return $this->country_id; } /** * Set postcode_id * * @param integer $postcodeId * @return PropertyData */ public function setPostcodeId($postcodeId) { $this->postcode_id = $postcodeId; return $this; } /** * Get postcode_id * * @return integer */ public function getPostcodeId() { return $this->postcode_id; } /** * Set council_id * * @param integer $councilId * @return PropertyData */ public function setCouncilId($councilId) { $this->council_id = $councilId; return $this; } /** * Get council_id * * @return integer */ public function getCouncilId() { return $this->council_id; } /** * Set short_description * * @param string $shortDescription * @return PropertyData */ public function setShortDescription($shortDescription) { $this->short_description = $shortDescription; return $this; } /** * Get short_description * * @return string */ public function getShortDescription() { return $this->short_description; } /** * Set long_description * * @param string $longDescription * @return PropertyData */ public function setLongDescription($longDescription) { $this->long_description = $longDescription; return $this; } /** * Get long_description * * @return string */ public function getLongDescription() { return $this->long_description; } /** * Set size_sq_ft * * @param integer $sizeSqFt * @return PropertyData */ public function setSizeSqFt($sizeSqFt) { $this->size_sq_ft = $sizeSqFt; return $this; } /** * Get size_sq_ft * * @return integer */ public function getSizeSqFt() { return $this->size_sq_ft; } /** * Set property_type_id * * @param integer $propertyTypeId * @return PropertyData */ public function setPropertyTypeId($propertyTypeId) { $this->property_type_id = $propertyTypeId; return $this; } /** * Get property_type_id * * @return integer */ public function getPropertyTypeId() { return $this->property_type_id; } /** * Set floor_level * * @param integer $floorLevel * @return PropertyData */ public function setFloorLevel($floorLevel) { $this->floor_level = $floorLevel; return $this; } /** * Get floor_level * * @return integer */ public function getFloorLevel() { return $this->floor_level; } /** * Set property_age * * @param integer $propertyAge * @return PropertyData */ public function setPropertyAge($propertyAge) { $this->property_age = $propertyAge; return $this; } /** * Get property_age * * @return integer */ public function getPropertyAge() { return $this->property_age; } /** * Set tenure_type * * @param string $tenureType * @return PropertyData */ public function setTenureType($tenureType) { $this->tenure_type = $tenureType; return $this; } /** * Get tenure_type * * @return string */ public function getTenureType() { return $this->tenure_type; } /** * Set garage * * @param integer $garage * @return PropertyData */ public function setGarage($garage) { $this->garage = $garage; return $this; } /** * Get garage * * @return integer */ public function getGarage() { return $this->garage; } /** * Set num_living_rooms * * @param integer $numLivingRooms * @return PropertyData */ public function setNumLivingRooms($numLivingRooms) { $this->num_living_rooms = $numLivingRooms; return $this; } /** * Get num_living_rooms * * @return integer */ public function getNumLivingRooms() { return $this->num_living_rooms; } /** * Set num_bathrooms * * @param integer $numBathrooms * @return PropertyData */ public function setNumBathrooms($numBathrooms) { $this->num_bathrooms = $numBathrooms; return $this; } /** * Get num_bathrooms * * @return integer */ public function getNumBathrooms() { return $this->num_bathrooms; } /** * Set num_bedrooms * * @param integer $numBedrooms * @return PropertyData */ public function setNumBedrooms($numBedrooms) { $this->num_bedrooms = $numBedrooms; return $this; } /** * Get num_bedrooms * * @return integer */ public function getNumBedrooms() { return $this->num_bedrooms; } /** * Set num_floors * * @param integer $numFloors * @return PropertyData */ public function setNumFloors($numFloors) { $this->num_floors = $numFloors; return $this; } /** * Get num_floors * * @return integer */ public function getNumFloors() { return $this->num_floors; } /** * Set num_receptions * * @param integer $numReceptions * @return PropertyData */ public function setNumReceptions($numReceptions) { $this->num_receptions = $numReceptions; return $this; } /** * Get num_receptions * * @return integer */ public function getNumReceptions() { return $this->num_receptions; } /** * Set region_id * * @param integer $regionId * @return PropertyData */ public function setRegionId($regionId) { $this->region_id = $regionId; return $this; } /** * Get region_id * * @return integer */ public function getRegionId() { return $this->region_id; } /** * Set created_at * * @param \DateTime $createdAt * @return PropertyData */ public function setCreatedAt($createdAt) { $this->created_at = $createdAt; return $this; } /** * Get created_at * * @return \DateTime */ public function getCreatedAt() { return $this->created_at; } /** * Set updated_at * * @param \DateTime $updatedAt * @return PropertyData */ public function setUpdatedAt($updatedAt) { $this->updated_at = $updatedAt; return $this; } /** * Get updated_at * * @return \DateTime */ public function getUpdatedAt() { return $this->updated_at; } /** * Set town * * @param \Minos\Bundle\PropertyBundle\Entity\UtilTown $town * @return PropertyData */ public function setTown(\Minos\Bundle\PropertyBundle\Entity\UtilTown $town = null) { $this->town = $town; return $this; } /** * Get town * * @return \Minos\Bundle\PropertyBundle\Entity\UtilTown */ public function getTown() { return $this->town; } /** * Set county * * @param \Minos\Bundle\PropertyBundle\Entity\UtilCounty $county * @return PropertyData */ public function setCounty(\Minos\Bundle\PropertyBundle\Entity\UtilCounty $county = null) { $this->county = $county; return $this; } /** * Get county * * @return \Minos\Bundle\PropertyBundle\Entity\UtilCounty */ public function getCounty() { return $this->county; } /** * Set country * * @param \Minos\Bundle\PropertyBundle\Entity\UtilCountry $country * @return PropertyData */ public function setCountry(\Minos\Bundle\PropertyBundle\Entity\UtilCountry $country = null) { $this->country = $country; return $this; } /** * Get country * * @return \Minos\Bundle\PropertyBundle\Entity\UtilCountry */ public function getCountry() { return $this->country; } /** * Set council * * @param \Minos\Bundle\PropertyBundle\Entity\UtilCouncil $council * @return PropertyData */ public function setCouncil(\Minos\Bundle\PropertyBundle\Entity\UtilCouncil $council = null) { $this->council = $council; return $this; } /** * Get council * * @return \Minos\Bundle\PropertyBundle\Entity\UtilCouncil */ public function getCouncil() { return $this->council; } /** * Set region * * @param \Minos\Bundle\PropertyBundle\Entity\UtilRegions $region * @return PropertyData */ public function setRegion(\Minos\Bundle\PropertyBundle\Entity\UtilRegions $region = null) { $this->region = $region; return $this; } /** * Get region * * @return \Minos\Bundle\PropertyBundle\Entity\UtilRegions */ public function getRegion() { return $this->region; } /** * Set postcode * * @param \Minos\Bundle\PropertyBundle\Entity\UtilPostcode $postcode * @return PropertyData */ public function setPostcode(\Minos\Bundle\PropertyBundle\Entity\UtilPostcode $postcode = null) { $this->postcode = $postcode; return $this; } /** * Get postcode * * @return \Minos\Bundle\PropertyBundle\Entity\UtilPostcode */ public function getPostcode() { return $this->postcode; } /** * Set property_type * * @param \Minos\Bundle\PropertyBundle\Entity\UtilPropertyType $propertyType * @return PropertyData */ public function setPropertyType(\Minos\Bundle\PropertyBundle\Entity\UtilPropertyType $propertyType = null) { $this->property_type = $propertyType; return $this; } /** * Get property_type * * @return \Minos\Bundle\PropertyBundle\Entity\UtilPropertyType */ public function getPropertyType() { return $this->property_type; } /** * Add prices * * @param \Minos\Bundle\PropertyBundle\Entity\PropertyPrice $prices * @return PropertyData */ public function addPrice(\Minos\Bundle\PropertyBundle\Entity\PropertyPrice $prices) { $this->prices[] = $prices; return $this; } /** * Remove prices * * @param \Minos\Bundle\PropertyBundle\Entity\PropertyPrice $prices */ public function removePrice(\Minos\Bundle\PropertyBundle\Entity\PropertyPrice $prices) { $this->prices->removeElement($prices); } /** * Get prices * * @return \Doctrine\Common\Collections\Collection */ public function getPrices() { return $this->prices; } /** * Set status * * @param integer $status * @return PropertyData */ public function setStatus($status) { $this->status = $status; return $this; } /** * Get status * * @return integer */ public function getStatus() { return $this->status; } /** * Set display_address * * @param string $displayAddress * @return PropertyData */ public function setDisplayAddress($displayAddress) { $this->display_address = $displayAddress; return $this; } /** * Get display_address * * @return string */ public function getDisplayAddress() { return $this->display_address; } /** * Set deposit_required * * @param integer $depositRequired * @return PropertyData */ public function setDepositRequired($depositRequired) { $this->deposit_required = $depositRequired; return $this; } /** * Get deposit_required * * @return integer */ public function getDepositRequired() { return $this->deposit_required; } /** * Set deposit_required_amount * * @param integer $depositRequiredAmount * @return PropertyData */ public function setDepositRequiredAmount($depositRequiredAmount) { $this->deposit_required_amount = $depositRequiredAmount; return $this; } /** * Get deposit_required_amount * * @return integer */ public function getDepositRequiredAmount() { return $this->deposit_required_amount; } /** * Set rent_advance * * @param integer $rentAdvance * @return PropertyData */ public function setRentAdvance($rentAdvance) { $this->rent_advance = $rentAdvance; return $this; } /** * Get rent_advance * * @return integer */ public function getRentAdvance() { return $this->rent_advance; } /** * Set rent_advance_amount * * @param integer $rentAdvanceAmount * @return PropertyData */ public function setRentAdvanceAmount($rentAdvanceAmount) { $this->rent_advance_amount = $rentAdvanceAmount; return $this; } /** * Get rent_advance_amount * * @return integer */ public function getRentAdvanceAmount() { return $this->rent_advance_amount; } /** * Set rent_contract_length * * @param integer $rentContractLength * @return PropertyData */ public function setRentContractLength($rentContractLength) { $this->rent_contract_length = $rentContractLength; return $this; } /** * Get rent_contract_length * * @return integer */ public function getRentContractLength() { return $this->rent_contract_length; } /** * Set main_image * * @param string $mainImage * @return PropertyData */ public function setMainImage($mainImage) { $this->main_image = $mainImage; return $this; } /** * Get main_image * * @return string */ public function getMainImage() { return $this->main_image; } /** * Set images * * @param array $images * @return PropertyData */ public function setImages($images) { $this->images = $images; return $this; } /** * Get images * * @return array */ public function getImages() { return $this->images; } /** * Set key_features * * @param string $keyFeatures * @return PropertyData */ public function setKeyFeatures($keyFeatures) { $this->key_features = $keyFeatures; return $this; } /** * Get key_features * * @return string */ public function getKeyFeatures() { return $this->key_features; } /** * Set floorplans * * @param array $floorplans * @return PropertyData */ public function setFloorplans($floorplans) { $this->floorplans = $floorplans; return $this; } /** * Get floorplans * * @return array */ public function getFloorplans() { return $this->floorplans; } /** * Set epc * * @param string $epc * @return PropertyData */ public function setEpc($epc) { $this->epc = $epc; return $this; } /** * Get epc * * @return string */ public function getEpc() { return $this->epc; } /** * Set sold_at * * @param \DateTime $soldAt * @return PropertyData */ public function setSoldAt($soldAt) { $this->sold_at = $soldAt; return $this; } /** * Get sold_at * * @return \DateTime */ public function getSoldAt() { return $this->sold_at; } /** * Set freehold_length * * @param integer $freeholdLength * @return PropertyData */ public function setFreeholdLength($freeholdLength) { $this->freehold_length = $freeholdLength; return $this; } /** * Get freehold_length * * @return integer */ public function getFreeholdLength() { return $this->freehold_length; } /** * Set accepted_tennants * * @param array $acceptedTennants * @return PropertyData */ public function setAcceptedTennants($acceptedTennants) { $this->accepted_tennants = $acceptedTennants; return $this; } /** * Get accepted_tennants * * @return array */ public function getAcceptedTennants() { return $this->accepted_tennants; } /** * Set min_offer_amount * * @param integer $minOfferAmount * @return PropertyData */ public function setMinOfferAmount($minOfferAmount) { $this->min_offer_amount = $minOfferAmount; return $this; } /** * Get min_offer_amount * * @return integer */ public function getMinOfferAmount() { return $this->min_offer_amount; } /** * Set date_available * * @param \DateTime $dateAvailable * @return PropertyData */ public function setDateAvailable($dateAvailable) { $this->date_available = $dateAvailable; return $this; } /** * Get date_available * * @return \DateTime */ public function getDateAvailable() { return $this->date_available; } /** * Set max_advance_rental_date * * @param \DateTime $maxAdvanceRentalDate * @return PropertyData */ public function setMaxAdvanceRentalDate($maxAdvanceRentalDate) { $this->max_advance_rental_date = $maxAdvanceRentalDate; return $this; } /** * Get max_advance_rental_date * * @return \DateTime */ public function getMaxAdvanceRentalDate() { return $this->max_advance_rental_date; } /** * Set guarantor * * @param integer $guarantor * @return PropertyData */ public function setGuarantor($guarantor) { $this->guarantor = $guarantor; return $this; } /** * Get guarantor * * @return integer */ public function getGuarantor() { return $this->guarantor; } } ``` And this is the one that extends it: ``` php <?php namespace Howsmart\Bundle\PropertyBundle\Entity; use Doctrine\ORM\Mapping as ORM; use json_array; use Minos\Bundle\PropertyBundle\Entity\PropertyData; /** * Property * * @ORM\Entity(repositoryClass="Howsmart\Bundle\PropertyBundle\Entity\PropertyRepository") * */ class Property extends PropertyData { /** * @ORM\Column(type="integer") */ protected $flag_yield = 0; /** * @ORM\Column(type="decimal", scale=2) */ protected $yield = 0.00; /** * @ORM\ManyToOne(targetEntity="\Howsmart\Bundle\AgentBundle\Entity\Agent", inversedBy="properties") * @ORM\JoinColumn(name="agent_id", referencedColumnName="id") */ protected $agent; /** * @ORM\Column(type="integer") */ private $investment_score_accuracy = 0; /** * @ORM\Column(type="integer") */ private $investment_score = 0; /** * @ORM\Column(type="json_array") */ private $investment_calculations; /** * @ORM\Column(type="integer") */ private $flag_valuation = 0; /** * @ORM\Column(type="integer") */ private $flag_score = 0; /** * @ORM\Column(type="integer") */ private $flag_price_paid = 0; /** * @ORM\Column(type="integer") */ private $agent_id = 0; /** * @ORM\Column(type="integer") */ private $score_land_property = 0; /** * @ORM\Column(type="integer") */ private $score_transport_infrastructure = 0; /** * @ORM\Column(type="integer") */ private $score_education_employement = 0; /** * @ORM\Column(type="integer") */ private $score_safety_comfort = 0; /** * @ORM\Column(type="integer") */ private $score_lifestyle_leisure = 0; /** * @ORM\Column(type="integer") */ private $soft_views_today = 0; /** * @ORM\Column(type="integer") */ private $views_today = 0; /** * @ORM\Column(type="integer") */ private $soft_views_yesterday = 0; /** * @ORM\Column(type="integer") */ private $views_yesterday = 0; /** * @ORM\Column(type="integer") */ private $soft_views_weekly = 0; /** * @ORM\Column(type="integer") */ private $views_weekly = 0; /** * @ORM\Column(type="integer") */ private $soft_views_total = 0; /** * @ORM\Column(type="integer") */ private $views_total = 0; /** * @ORM\Column(type="integer", nullable=false, options={"default": 0}) */ private $enquiries_today = 0; /** * @ORM\Column(type="integer", nullable=false, options={"default": 0}) */ private $enquiries_yesterday = 0; /** * @ORM\Column(type="integer", nullable=false, options={"default": 0}) */ private $enquiries_weekly = 0; /** * @ORM\Column(type="integer", nullable=false, options={"default": 0}) */ private $enquiries_total = 0; /** * @ORM\Column(type="integer") */ private $flag_growth = 0; /** * @ORM\Column(type="decimal", scale=2) */ private $growth = 0.00; /** * @ORM\OneToMany(targetEntity="\Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid", mappedBy="postcode") */ protected $data_price_paid; public function getListingPrice() { foreach ($this->getPrices() as $price) { if ($price->getPropertyStatus() == 1) { return $price->getPrice(); } } } public function getValuation() { foreach ($this->getPrices() as $price) { if ($price->getPropertyStatus() == 3 && $price->getPropertyType() == "sale") { return $price->getPrice(); } } } public function getRecommendedRental() { foreach ($this->getPrices() as $price) { if ($price->getPropertyStatus() == 3 && $price->getPropertyType() == "rent") { return $price->getPrice(); } } } /** * Set investment_score * * @param integer $investmentScore * @return Property */ public function setInvestmentScore($investmentScore) { $this->investment_score = $investmentScore; return $this; } /** * Get investment_score * * @return integer */ public function getInvestmentScore() { return $this->investment_score; } /** * Set investment_calculations * * @param array $investmentCalculations * @return Property */ public function setInvestmentCalculations($investmentCalculations) { $this->investment_calculations = $investmentCalculations; return $this; } /** * Get investment_calculations * * @return array */ public function getInvestmentCalculations() { return $this->investment_calculations; } /** * Set flag_valuation * * @param integer $flagValuation * @return Property */ public function setFlagValuation($flagValuation) { $this->flag_valuation = $flagValuation; return $this; } /** * Get flag_valuation * * @return integer */ public function getFlagValuation() { return $this->flag_valuation; } /** * Set flag_score * * @param integer $flagScore * @return Property */ public function setFlagScore($flagScore) { $this->flag_score = $flagScore; return $this; } /** * Get flag_score * * @return integer */ public function getFlagScore() { return $this->flag_score; } /** * Set flag_price_paid * * @param integer $flagPricePaid * @return Property */ public function setFlagPricePaid($flagPricePaid) { $this->flag_price_paid = $flagPricePaid; return $this; } /** * Get flag_price_paid * * @return integer */ public function getFlagPricePaid() { return $this->flag_price_paid; } /** * Set investment_score_accuracy * * @param integer $investmentScoreAccuracy * @return Property */ public function setInvestmentScoreAccuracy($investmentScoreAccuracy) { $this->investment_score_accuracy = $investmentScoreAccuracy; return $this; } /** * Get investment_score_accuracy * * @return integer */ public function getInvestmentScoreAccuracy() { return $this->investment_score_accuracy; } /** * Set score_land_property * * @param integer $scoreLandProperty * @return Property */ public function setScoreLandProperty($scoreLandProperty) { $this->score_land_property = $scoreLandProperty; return $this; } /** * Get score_land_property * * @return integer */ public function getScoreLandProperty() { return $this->score_land_property; } /** * Set score_transport_infrastructure * * @param integer $scoreTransportInfrastructure * @return Property */ public function setScoreTransportInfrastructure($scoreTransportInfrastructure) { $this->score_transport_infrastructure = $scoreTransportInfrastructure; return $this; } /** * Get score_transport_infrastructure * * @return integer */ public function getScoreTransportInfrastructure() { return $this->score_transport_infrastructure; } /** * Set score_education_employement * * @param integer $scoreEducationEmployement * @return Property */ public function setScoreEducationEmployement($scoreEducationEmployement) { $this->score_education_employement = $scoreEducationEmployement; return $this; } /** * Get score_education_employement * * @return integer */ public function getScoreEducationEmployement() { return $this->score_education_employement; } /** * Set score_safety_comfort * * @param integer $scoreSafetyComfort * @return Property */ public function setScoreSafetyComfort($scoreSafetyComfort) { $this->score_safety_comfort = $scoreSafetyComfort; return $this; } /** * Get score_safety_comfort * * @return integer */ public function getScoreSafetyComfort() { return $this->score_safety_comfort; } /** * Set score_lifestyle_leisure * * @param integer $scoreLifestyleLeisure * @return Property */ public function setScoreLifestyleLeisure($scoreLifestyleLeisure) { $this->score_lifestyle_leisure = $scoreLifestyleLeisure; return $this; } /** * Get score_lifestyle_leisure * * @return integer */ public function getScoreLifestyleLeisure() { return $this->score_lifestyle_leisure; } /** * Get data_price_paid * * @return \Doctrine\Common\Collections\Collection */ public function getDataPricePaid() { return $this->data_price_paid; } /** * Set soft_views * * @param integer $softViews * @return Property */ public function setSoftViews($softViews) { $this->soft_views = $softViews; return $this; } /** * Get soft_views * * @return integer */ public function getSoftViews() { return $this->soft_views; } /** * Set views * * @param integer $views * @return Property */ public function setViews($views) { $this->views = $views; return $this; } /** * Get views * * @return integer */ public function getViews() { return $this->views; } /** * Set agent * * @param \Howsmart\Bundle\AgentBundle\Entity\Agent $agent * @return Property */ public function setAgent(\Howsmart\Bundle\AgentBundle\Entity\Agent $agent = null) { $this->agent = $agent; return $this; } /** * Get agent * * @return \Howsmart\Bundle\AgentBundle\Entity\Agent */ public function getAgent() { return $this->agent; } /** * Set flag_yield * * @param integer $flagYield * @return Property */ public function setFlagYield($flagYield) { $this->flag_yield = $flagYield; return $this; } /** * Get flag_yield * * @return integer */ public function getFlagYield() { return $this->flag_yield; } /** * Set yield * * @param string $yield * @return Property */ public function setYield($yield) { $this->yield = $yield; return $this; } /** * Get yield * * @return string */ public function getYield() { return $this->yield; } /** * Set soft_views_today * * @param integer $softViewsToday * @return Property */ public function setSoftViewsToday($softViewsToday) { $this->soft_views_today = $softViewsToday; return $this; } /** * Get soft_views_today * * @return integer */ public function getSoftViewsToday() { return $this->soft_views_today; } /** * Set views_today * * @param integer $viewsToday * @return Property */ public function setViewsToday($viewsToday) { $this->views_today = $viewsToday; return $this; } /** * Get views_today * * @return integer */ public function getViewsToday() { return $this->views_today; } /** * Set soft_views_yesterday * * @param integer $softViewsYesterday * @return Property */ public function setSoftViewsYesterday($softViewsYesterday) { $this->soft_views_yesterday = $softViewsYesterday; return $this; } /** * Get soft_views_yesterday * * @return integer */ public function getSoftViewsYesterday() { return $this->soft_views_yesterday; } /** * Set views_yesterday * * @param integer $viewsYesterday * @return Property */ public function setViewsYesterday($viewsYesterday) { $this->views_yesterday = $viewsYesterday; return $this; } /** * Get views_yesterday * * @return integer */ public function getViewsYesterday() { return $this->views_yesterday; } /** * Set soft_views_weekly * * @param integer $softViewsWeekly * @return Property */ public function setSoftViewsWeekly($softViewsWeekly) { $this->soft_views_weekly = $softViewsWeekly; return $this; } /** * Get soft_views_weekly * * @return integer */ public function getSoftViewsWeekly() { return $this->soft_views_weekly; } /** * Set views_weekly * * @param integer $viewsWeekly * @return Property */ public function setViewsWeekly($viewsWeekly) { $this->views_weekly = $viewsWeekly; return $this; } /** * Get views_weekly * * @return integer */ public function getViewsWeekly() { return $this->views_weekly; } /** * Set soft_views_total * * @param integer $softViewsTotal * @return Property */ public function setSoftViewsTotal($softViewsTotal) { $this->soft_views_total = $softViewsTotal; return $this; } /** * Get soft_views_total * * @return integer */ public function getSoftViewsTotal() { return $this->soft_views_total; } /** * Set views_total * * @param integer $viewsTotal * @return Property */ public function setViewsTotal($viewsTotal) { $this->views_total = $viewsTotal; return $this; } /** * Get views_total * * @return integer */ public function getViewsTotal() { return $this->views_total; } /** * Add data_price_paid * * @param \Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid $dataPricePaid * @return Property */ public function addDataPricePaid(\Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid $dataPricePaid) { $this->data_price_paid[] = $dataPricePaid; return $this; } /** * Remove data_price_paid * * @param \Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid $dataPricePaid */ public function removeDataPricePaid(\Howsmart\Bundle\PropertyBundle\Entity\DataPricePaid $dataPricePaid) { $this->data_price_paid->removeElement($dataPricePaid); } /** * Set flag_growth * * @param integer $flagGrowth * @return Property */ public function setFlagGrowth($flagGrowth) { $this->flag_growth = $flagGrowth; return $this; } /** * Get flag_growth * * @return integer */ public function getFlagGrowth() { return $this->flag_growth; } /** * Set growth * * @param string $growth * @return Property */ public function setGrowth($growth) { $this->growth = $growth; return $this; } /** * Get growth * * @return string */ public function getGrowth() { return $this->growth; } /** * Set enquiries_today * * @param integer $enquiriesToday * @return Property */ public function setEnquiriesToday($enquiriesToday) { $this->enquiries_today = $enquiriesToday; return $this; } /** * Get enquiries_today * * @return integer */ public function getEnquiriesToday() { return $this->enquiries_today; } /** * Set enquiries_yesterday * * @param integer $enquiriesYesterday * @return Property */ public function setEnquiriesYesterday($enquiriesYesterday) { $this->enquiries_yesterday = $enquiriesYesterday; return $this; } /** * Get enquiries_yesterday * * @return integer */ public function getEnquiriesYesterday() { return $this->enquiries_yesterday; } /** * Set enquiries_weekly * * @param integer $enquiriesWeekly * @return Property */ public function setEnquiriesWeekly($enquiriesWeekly) { $this->enquiries_weekly = $enquiriesWeekly; return $this; } /** * Get enquiries_weekly * * @return integer */ public function getEnquiriesWeekly() { return $this->enquiries_weekly; } /** * Set enquiries_total * * @param integer $enquiriesTotal * @return Property */ public function setEnquiriesTotal($enquiriesTotal) { $this->enquiries_total = $enquiriesTotal; return $this; } /** * Get enquiries_total * * @return integer */ public function getEnquiriesTotal() { return $this->enquiries_total; } /** * Set agent_id * * @param integer $agentId * @return Property */ public function setAgentId($agentId) { $this->agent_id = $agentId; return $this; } /** * Get agent_id * * @return integer */ public function getAgentId() { return $this->agent_id; } } ``` The base entity is in a package and then the extended one is in the website bundle - just to clear up the name space differences :+1: Thanks!!
Author
Owner

@kitsunet commented on GitHub (Dec 15, 2015):

In a single table inheritance you cannot extend with non nullable fields because any other inherited class that doesn't have the fields would fail to persist.

@kitsunet commented on GitHub (Dec 15, 2015): In a single table inheritance you cannot extend with non nullable fields because any other inherited class that doesn't have the fields would fail to persist.
Author
Owner

@DHager commented on GitHub (Dec 15, 2015):

@HarryWiseman There's something wrong with your code-paste. I'm only seeing the tail ends of each class with all the methods, not the important part which is the class-declaration and the variable-declarations.

As @kitsunet mentions, you may be running afoul of:

6.2.3. SQL Schema considerations

For Single-Table-Inheritance to work in scenarios where you are using either a legacy database schema or a self-written database schema you have to make sure that all columns that are not in the root entity but in any of the different sub-entities has to allows null values. Columns that have NOT NULL constraints have to be on the root entity of the single-table inheritance hierarchy.

@DHager commented on GitHub (Dec 15, 2015): @HarryWiseman There's something wrong with your code-paste. I'm only seeing the tail ends of each class with all the methods, not the important part which is the class-declaration and the variable-declarations. As @kitsunet mentions, you may be running afoul of: > [6.2.3. SQL Schema considerations](http://doctrine-orm.readthedocs.org/projects/doctrine-orm/en/latest/reference/inheritance-mapping.html#sql-schema-considerations) > > For Single-Table-Inheritance to work in scenarios where you are using either a legacy database schema or a self-written database schema you have to make sure that all columns that are not in the root entity but in any of the different sub-entities has to allows null values. Columns that have NOT NULL constraints have to be on the root entity of the single-table inheritance hierarchy.
Author
Owner

@Ocramius commented on GitHub (Dec 16, 2015):

Fixed the pasted bit.

@Ocramius commented on GitHub (Dec 16, 2015): Fixed the pasted bit.
Author
Owner

@Ocramius commented on GitHub (Dec 16, 2015):

@kitsunet in a single table inheritance, all fields in child tables MUST be nullable, as they will be only filled for sub-type records. If they were non-nullable, you wouldn't be able to insert any data for a parent type (or any sibling type).

Also, PLEASE REDUCE code snippets when pasting them: it took me more to read and find the problem in the code examples than to actually reach the conclusion.

This is expected behavior, closing.

@Ocramius commented on GitHub (Dec 16, 2015): @kitsunet in a single table inheritance, all fields in child tables MUST be nullable, as they will be only filled for sub-type records. If they were non-nullable, you wouldn't be able to insert any data for a parent type (or any sibling type). Also, PLEASE REDUCE code snippets when pasting them: it took me more to read and find the problem in the code examples than to actually reach the conclusion. This is expected behavior, closing.
Author
Owner

@kitsunet commented on GitHub (Dec 16, 2015):

@HarryWiseman I think the above mention of me was in fact for you...

@kitsunet commented on GitHub (Dec 16, 2015): @HarryWiseman I think the above mention of me was in fact for you...
Author
Owner

@Ocramius commented on GitHub (Dec 16, 2015):

@kitsunet sorry!

@Ocramius commented on GitHub (Dec 16, 2015): @kitsunet sorry!
Author
Owner

@kitsunet commented on GitHub (Dec 16, 2015):

@Ocramius No worries :)

@kitsunet commented on GitHub (Dec 16, 2015): @Ocramius No worries :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4937